stellarwp / arrays
A library for array manipulation.
Installs: 179 256
Dependents: 4
Suggesters: 0
Security: 0
Stars: 4
Watchers: 5
Forks: 0
Open Issues: 1
Requires
- illuminate/collections: ^8.0
Requires (Dev)
- codeception/module-asserts: ^1.0
- codeception/module-cli: ^1.0
- codeception/module-db: ^1.0
- codeception/module-filesystem: ^1.0
- codeception/module-phpbrowser: ^1.0
- codeception/module-rest: ^1.0
- codeception/module-webdriver: ^1.0
- codeception/util-universalframework: ^1.0
- lucatume/wp-browser: ^3.0.14
- phpunit/phpunit: ~6.0
- saggre/phpdocumentor-markdown: ^0.1.3
- symfony/event-dispatcher-contracts: ^2.5.1
- symfony/string: ^5.4
- szepeviktor/phpstan-wordpress: ^1.1
README
A library for array manipulations.
Table of contents
- Installation
- Notes on examples
- Array utils
- accessible
- add
- add_prefixed_keys_to
- add_unprefixed_keys_to
- array_visit_recursive
- collapse
- destringify_keys
- dot
- escape_multidimensional_array
- except
- exists
- filter_to_flat_scalar_associative_array
- filter_prefixed
- first
- flatten
- forget
- get
- get_first_set
- get_in_any
- has
- insert_after_key
- insert_before_key
- is_assoc
- is_list
- join
- last
- list_to_array
- map_or_discard
- merge_recursive
- merge_recursive_query_vars
- only
- parse_associative_array_alias
- prepend
- pull
- query
- random
- recursive_ksort
- remove_numeric_keys_recursive
- remove_string_keys_recursive
- set
- shape_filter
- shuffle
- sort_by_priority
- sort_recursive
- sort_recursive_desc
- stringify_keys
- strpos
- to_list
- undot
- usearch
- where
- where_not_null
- wrap
- Acknowledgements
Installation
It's recommended that you install Arrays as a project dependency via Composer:
composer require stellarwp/arrays
We actually recommend that this library gets included in your project using Strauss.
Luckily, adding Strauss to your
composer.json
is only slightly more complicated than adding a typical dependency, so checkout our strauss docs.
Notes on examples
Since the recommendation is to use Strauss to prefix this library's namespaces, all examples will be using the Boomshakalaka
namespace prefix.
Acknowledgements
A number of array methods were ported over from The Events Calendar and the Laravel Framework.