axy / arr-helpers
Some array helpers
Requires
- php: >=8.4
Requires (Dev)
- phpunit/phpunit: 12.2.7
- squizlabs/php_codesniffer: =3.7.2
README
Just some helpers for array transformations.
Used, for example, in axy/arr
.
It just a set of classes with static methods.
Are located in the axy\arr\helpers
namespace.
Transformation methods takes a native array. It isn't modified in place but the transformation result is returned.
- List or dictionary
- ArrayPathHelper
- ArrayMapHelper
- ArrayFilterHelper
- ArraySortHelper
- ArrayUniqueHelper
- ArrayKeysHelper
- ArrayConverterHelper
Validation of arguments
It is implied that incoming array can be received from an unsafe place.
It may not even be an array (that's why the $input
argument is usually typified as mixed
).
The library try to process it without fatal errors.
But other arguments usually are not special validated.
If the $path
argument (see below) as array must have only strings or integers this is the area of responsibility of the external code.
The library will not check each step.