Download the PHP package k-gun/xo without Composer

On this page you can find all versions of the php package k-gun/xo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package xo

XO is a library that provides some e(x)tended (o)bjects to build strictly typed arrays such as Map, Set, Tuple or any type of TypedArray's, and also String and Number objects that are not objects natively in PHP.

You can use Map, Set and Tuple to build strict arrays and also use AnyArray (ArrayObject and Collection are just aliases of it) derived from AbstractArray that contains many native-equal array methods or StringObject and NumberObject to use AbstractScalarObject interface.

All XO objects extends AbstractObject, so that makes possible to use some basic object methods like getName() or getShortName().

In a Nutshell


Installation

Use can also download and use without Composer including boot.php.

Using Array Objects

Basically there are 5 types of array in XO;

TypedArray: Int or String keyed object derived from AbstractArray.

AnyArray: String keyed object derived from TypedArray.

Map: String keyed object derived from TypedArray.

Set: Int keyed object derived from TypedArray.

Tuple: Int keyed and read-only object derived from TypedArray.

But, off course, you can create new typed array objects via TypedArray directly like in first example or defining new arrays that extend TypedArray or other objects such as Map, Set, Tuple or AnyArray.

Typed array example;

Yet another example;

If you want to make a untyped array, you can simply use AnyArray. So that will provide all methods as well likely on the other arrays.

Here is another example with AnyArray like above;

Custom Arrays

Creating custom arrays;

Besides, it also possible with Set or Map;

Using String and Number Objects

Objects, Object Methods and Properties

Static and Util Objects

Exceptions

class xo\exception\Exception extends Exception {}

class xo\ArrayException extends xo\exception\Exception {}
class xo\StaticClassException extends xo\exception\Exception {}

class xo\util\UtilException extends xo\exception\Exception {}

class xo\exception\ArgumentException extends xo\exception\Exception {}
class xo\exception\ArgumentTypeException extends xo\exception\Exception {}
class xo\exception\KeyException extends xo\exception\Exception {}
class xo\exception\ValueException extends xo\exception\Exception {}
class xo\exception\MethodException extends xo\exception\Exception {}
class xo\exception\MutationException extends xo\exception\Exception {}
class xo\exception\NullException extends xo\exception\Exception {}
class xo\exception\TypeException extends xo\exception\Exception {}

Shortcut Functions

map(...$arguments): xo\Map
set(...$arguments): xo\Set
tuple(...$arguments): xo\Tuple
collection(...$arguments): xo\Collection
string(string $value): xo\StringObject
number(numeric $value): xo\NumberObject

All versions of xo with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package k-gun/xo contains the following files

Loading the files please wait ....