2017 © Pedro Peláez
 

library ecks

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

image

ecks/ecks

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  • Tuesday, February 6, 2018
  • by crantok
  • Repository
  • 2 Watchers
  • 0 Stars
  • 39 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

Ecks is..., (*1)

  • inspired by underscore.php
  • far from complete
  • highly likely to be broken

Ecks will be great because..., (*2)

  • it will have a "fluid" (i.e. call-chaining) interface, but without underscore.php's need for chain() and value() methods
  • it provides a KeyValuePair class which callbacks may return. Unlike underscore.php, this can give client code control over the indexing of a result array
  • instances of Ecks will be (almost, see below) interchangeable with arrays
  • it includes an array decorator (which implements Ecks' array interchangeability) that you can reuse for your own classes

Depending on what you want to do with Ecks, it may be a waste of your time because..., (*3)

  • PHP has global functions that operate on arrays and that check that a "native" PHP array is passed to them. Examples of this kind of function are array_intersect() and array_map(). If you inject an instance of Ecks in to your code where you would normally inject an array, and if you use this kind of global function in that code, then your code will fall over. You can always get the undecorated (i.e. unwrapped) array out of an instance of Ecks using Ecks::asArray(). It's up to you whether this meets your requirements.
  • Most of Ecks' methods are already available for native arrays as global PHP functions. A few of them are (or will be) new or different. For instance PHP's array_diff is dependent on the order of arguments. Ecks::diff() will not be. (It will return all elements that are not common to both arrays.) A few of Ecks' planned methods do not exist at all as global functions in PHP, e.g. Ecks::reduceRight().

The Versions

06/02 2018

dev-master

9999999-dev

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3 GPL-3.0-or-later

The Development Requires

by Justin Hellings

10/06 2015

0.0.12

0.0.12.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

05/06 2015

0.0.11

0.0.11.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

26/05 2015

0.0.10

0.0.10.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

15/05 2015

0.0.9

0.0.9.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

14/05 2015

0.0.8

0.0.8.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

14/05 2015

0.0.7

0.0.7.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

14/05 2015

0.0.6

0.0.6.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

06/05 2015

0.0.5

0.0.5.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

26/02 2015

0.0.4

0.0.4.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

23/02 2015

0.0.3

0.0.3.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

12/02 2015

0.0.2

0.0.2.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings

06/02 2015

0.0.1

0.0.1.0

An array decorator that adds a fluid functional interface similar to that of an Array in Ruby. Inspired by underscore.php.

  Sources   Download

GPL3

The Development Requires

by Justin Hellings