j45l / abstract-data-structures-php
Abstract data structures for PHP
4.0.4
2023-05-23 04:33 UTC
Requires
- php: ~8.1
- infection/infection: ^0.26.5
- j45l/cats-php: dev-main
- j45l/functional-php: >=3.0.11
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- jetbrains/phpstorm-attributes: ^1.0
- phpmd/phpmd: ^2.10
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: 1.4.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^7.0 || ^8.0 || ^9.5
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: *
README
Immutable data structures
Persistent data structured, not optimized for big collections/arrays
All collection are typed, extend from the base type, set the allowed type by overriding abstract public function type(): string;
, return must the desired type classname.
When a getter operation would produce a mutation, a two elements array is returned, the first element would be the modified collection, and the second one the got element.
$queue = Queue::fromArray([1, 2]);
Classes
-
MixedQueue
-
MixedCollection
-
Mixed