phpnomad / utils
1.0.3
2026-04-17 10:49 UTC
Requires (Dev)
- phpnomad/tests: ^0.1.0 || ^0.3.0
This package is auto-updated.
Last update: 2026-04-17 10:53:23 UTC
README
phpnomad/utils is the small set of helpers PHPNomad packages reach for when they need to work with arrays, strings, numbers, and objects. It ships an Arr static helper alongside Str, Num, and Obj companions, plus two processor classes (ArrayProcessor and ListFilter) for chainable transforms and queries. Zero runtime dependencies, used throughout the PHPNomad ecosystem.
Installation
composer require phpnomad/utils
Overview
Arrcovers filtering, sorting, plucking, flattening, hydrating, casting, and dot-notation lookups for nested values, along witharray_*proxies that take the input array as the first argument.Str,Num, andObjhandle the usual companion work: case conversion, pluralization, percentage math, and nested object access with getter-method fallback.ArrayProcessorwraps anyArrmethod into a chain, holds the array through each step, and can be cast to a string with a configurable separator.ListFilterqueries an array of objects with chainable predicates covering dot-notation field access,in/notIn/and/equals, numeric comparisons, instance-type checks, key filters, and arbitrary callbacks.- No runtime dependencies, so importing it anywhere in a PHPNomad stack stays cheap.
Documentation
Full API reference and usage examples live at phpnomad.com.
License
MIT. See LICENSE.txt.