Everyone needs a little assistance!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmarks
src
tests
.editorconfig
.gitignore
.pullapprove.yml
.travis.yml
CHANGELOG.md
LICENSE
README.md
composer.json
phpbench.json.dist
phpunit.xml.dist

README.md

Equip Assist

Latest Stable Version License Build Status Code Coverage Scrutinizer Code Quality

Everyone needs a little assistance! Attempts to be PSR-1 and PSR-2 compliant.

Array Functions

All array functions:

  • put the array as the first parameter
  • work with both arrays and Traversable parameters

Import any function with use function Equip\Arr\func;.

List of functions

exists($source, $key) check if a key exists in an array.

to_array($value) convert a value to an array.

get($source, $key, $default) get a value from an array, or the default.

some($source, $keys) get some values from an array.

without($source, $keys) get an array without some values.

expect($source, $keys, $default) get some values from an array, ensuring all keys are defined.

head($list) get the first value from a list.

tail($list) get the last value from a list.

index_by($source, $key) index a collection by a key.

column($source, $column) get a list of values from a collection.

typed($source, $types) type cast defined values in an array.