Download the PHP package yannoff/collections without Composer

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

yannoff/collections

A simple object implementation of PHP arrays.

Latest Stable Version Total Downloads License

The concept

Based upon the Decorator design pattern, the aim is to provide a flexible, object-oriented alternative to PHP Arrays.

Installation

Using composer:

Usage

Example: PHP Array vs Collection

The classic way - native PHP arrays:

The new way - using collections:

Methods

See the full method list for more details.

Array / Collection method equivalences:

Array Collection
implode($glue, $array) $collection->join($glue)
array_filter($array, $callback, $flag) $collection->filter($callback, $flag)
array_flip($array) $collection->flip()
array_keys($array) $collection->keys()
array_map($callback, $array, ..$arrays) $collection->map($callback, ...$arrays)
array_pop(&$array) $collection->pop()
array_push(&$array, $element) $collection->push($element)
array_reverse($array) $collection->reverse()
array_search($needle, $array) $collection->search($needle)
array_slice($array, $offset, $length) $collection->slice($offset, $length)
array_shift(&$array) $collection->shift()
array_unique($array, $flags) $collection->unique($flags)
array_unshift(&$array, $element) $collection->unshift($element)
array_walk(&$array, $callback, $userdata) $collection->walk($callback, $userdata)
explode($separator, $strint, $limit) Collection::explode($separator, $strint, $limit)
current(&$array) $collection->current()
end(&$array) $collection->end()
next(&$array) $collection->next()
prev(&$array) $collection->prev()
sort(&$array) $collection->sort()
asort(&$array) $collection->asort()
ksort(&$array) $collection->ksort()

Along with those classical PHP methods wrappers, a few bag methods are provided:

method description
add($key, $element) Add an element at the given key in the collection
all() Return all the collection elements
clear() Remove all elements from the collection
get($key) Get an element of the collection by its key
has($key) Check for existence of the given key in the collection
set($elements) Set the whole elements of the collection

License

Released under the MIT License


All versions of collections with dependencies

PHP Build Version
Package Version
No informations.
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 yannoff/collections contains the following files

Loading the files please wait ...