equip/assist

Everyone needs a little assistance

1.6.0 2016-11-22 21:27 UTC

This package is auto-updated.

Last update: 2024-11-09 04:33:53 UTC


README

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.