2017 © Pedro Peláez
 

library colada

Collections framework for PHP

image

alexeyshockov/colada

Collections framework for PHP

  • Wednesday, April 27, 2016
  • by alexeyshockov
  • Repository
  • 6 Watchers
  • 31 Stars
  • 299 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 4 Forks
  • 17 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

Colada

Latest Stable Version Build Status Test Coverage, (*1)

Goal

Convenient and safe way to work with collections., (*2)

...And it's been (more or less) solved by some other libraries, like nikic/iter, doctrine/collections or even php-ds/php-ds. That's why the current version of the library contains just a few helpers for that libraries, to conveniently integrate them together., (*3)

Installation

composer require alexeyshockov/colada:~3.0

Usage

The library's functions are split by namespaces, one namespace = specific function a dependency (in most cases)., (*4)

\Colada\ds\{group_by}

Helpers from this namespace require php-ds/php-ds to be available., (*5)

group_by() function prodices a two dimension array (\ArrayObject or \Ds\Map, depends on the group key type), from an iterable based on a group function., (*6)

TODO

\Colada\GuzzleHttp\{coroutine_invoke, coroutine, time_sleep}

\Colada\React\{coroutine_invoke, coroutine}

Helpers from this namespace require guzzlehttp/promises or react/promise to be available., (*7)

This is the same concept applied to two most popular libs with async capabilities. If you are familiar with async/await in C# or node.js or coroutines in Go, this should be simple. Take a look at the script, written in callback-style and in coroutine-style:, (*8)

TODO
TODO

\Colada\iter\opt\{get, head, last, find_one}

Helpers from this namespace require phpoption/phpoption to be available., (*9)

\Colada\iter\{to_kv_pairs, each_n_and_last, uasort, uksort}

Simple helpers for general iterable types., (*10)

uasort() and uksort() are basically equivalents for the internal ones, but work for arbitrary iterable type., (*11)

Contributing

Running Tests

To run all the tests, install the vendors (with Composer) and execute:, (*12)

vendor/bin/phpunit --testdox

Public API

All classes or functions that are intended to be used by a user should be marked with @api PHPDoc tag. Anything without this mark are internal and should not be used by the end user (no guarantees that the interface will stay the same between versions)., (*13)

The Versions

27/04 2016

dev-develop

dev-develop http://github.com/alexeyshockov/colada

Collections framework for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Semen Barabash

collections functional

24/12 2013

dev-master

9999999-dev http://github.com/alexeyshockov/colada

Collections framework for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Semen Barabash

collections

15/05 2013

v1.0.0

1.0.0.0 http://github.com/alexeyshockov/colada

Collections framework for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

collections