dev-master
9999999-devFunctional utility library
The Requires
by Edan Schwartz
v1.4.0
1.4.0.0Functional utility library
The Requires
by Edan Schwartz
1.2.0
1.2.0.0Functional utility library
The Requires
by Edan Schwartz
Functional utility library
Functional utility library for PHP., (*1)
Plucks a property from a collection of associative arrays., (*2)
eg:, (*3)
Fn\pluck([ ['name' => 'moe', 'age' => 45], ['name' => 'larry', 'age' => 55], ['name' => 'curly', 'age' => 65] ], 'name'); // --> ['moe', 'larry', 'curly']
Add a value to an array, or merge a set of values., (*4)
Fn\concat(['a', 'b'], 'c'); // ['a', 'b', 'c'] Fn\concat(['a', 'b'], ['c', 'd']); // ['a', 'b', 'c', 'd']
Returns true if any item in the array passes a predicate, (*5)
Fn\any([1, 3, 4, 5, 9], Fn\even()) // true Fn\any([1, 3, 5, 9], Fn\even()) // false
Returns true if every item in the array passes a predicate, (*6)
Fn\all([1, 3, 5, 9], Fn\odd()) // true Fn\all([1, 3, 4, 5, 9], Fn\even()) // false
Invoke a callable some number of times., (*7)
Fn\times(3, function($i) { echo "call #$i"; }) // call 1 // call 2 // call 3
Functional utility library
Functional utility library
Functional utility library