Download the PHP package kuria/collections without Composer

On this page you can find all versions of the php package kuria/collections. 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 collections

Collections ###########

Object-oriented collection structures.

Features

Requirements

Collection

The Collection class implements a list of values with sequential integer indexes.

It also implements Countable, ArrayAccess and IteratorAggregate.

Creating a new collection

Empty collection

$collection = Collection::create();

Using an existing iterable

$collection = Collection::create(['foo', 'bar', 'baz']);

Using varargs

$collection = Collection::collect('foo', 'bar', 'baz');

Collection method overview

Refer to doc comments of the respective methods for more information.

Static methods

Instance methods


Collection instances can be accessed and iterated as regular arrays.

$collection = Collection::create();

// push some values $collection[] = 'foo'; $collection[] = 'bar'; $collection[] = 'baz';

// replace a value $collection[1] = 'new bar';

// remove a value unset($collection[2]);

// read values echo 'Value at index 1 is ', $collection[1], "\n"; echo 'Value at index 2 ', isset($collection[2]) ? 'exists' : 'does not exist', "\n";

// count values echo 'There are ', count($collection), ' values in total', "\n";

// iterate values foreach ($collection as $index => $value) { echo $index, ': ', $value, "\n"; }

Output:

Value at index 1 is new bar
Value at index 2 does not exist
There are 2 values in total
0: foo
1: new bar

Map

The Map class implements a key value map.

It also implements Countable, ArrayAccess and IteratorAggregate.

Creating a new map

Empty map

$map = Map::create();

Using an existing iterable

$map = Map::create(['foo' => 'bar', 'bar' => 'baz']);

Map method overview

Refer to doc comments of the respective methods for more information.

Static methods

Instance methods

Array access and iteration

Map instances can be accessed and iterated as regular arrays.

$map = Map::create();

// add some pairs $map['foo'] = 'bar'; $map['baz'] = 'qux'; $map['quux'] = 'quuz';

// remove a pair unset($map['baz']);

// read values echo 'Value with key "foo" is ', $map['foo'], "\n"; echo 'Value with key "baz" ', isset($map['baz']) ? 'exists' : 'does not exist', "\n";

// count pairs echo 'There are ', count($map), ' pairs in total', "\n";

// iterate pairs foreach ($map as $key => $value) { echo $key, ': ', $value, "\n"; }

Output:

Value with key "foo" is bar
Value with key "baz" does not exist
There are 2 pairs in total
foo: bar
quux: quuz

All versions of collections with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
kuria/iterable Version ^1.0
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 kuria/collections contains the following files

Loading the files please wait ....