jakub-frajt / typed-list
The array data types that contains only specific type of values. Substitution of missing generic types in PHP.
0.2
2022-03-17 10:27 UTC
Requires
- php: ^8.1
Requires (Dev)
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2024-05-17 14:56:34 UTC
README
Integer list
use Frajt\IntegerList; // create IntegerList from array $integerList = new IntegerList([1, 2, 30]); // numeric string values are automatically casted to integer $integerList = new IntegerList(['1', 2, 30]); $integerList->getValues(); // get values as array [1, 2, 30] // support \Iterator interface foreach ($integerList as $intValue) { echo $intValue.PHP_EOL; }