israelalagbe / php-custom-types
This package holds some custom PHP types such as Array and String. It provides functionalities similar to array and string in Javascript.
0.7.1
2024-03-16 17:16 UTC
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ^8
README
This package holds some custom PHP types such as Array and String. It provides functionalities similar to array and string in Javascript.
Installation
Require this package
composer require israelalagbe/php-custom-types
Array Types
Basic Usage
You can use it the following way
use IsraelAlagbe\CustomTypes\_Array; $items = new _Array([1,2]); // or _Array(1, 2) $items->push(4); // [1,2,4] $items->map(function($item) { return $item * 2; }); // [2, 4, 8] echo $items; //To get the original array, you can use print_r($items->toArray()); // [2, 4, 8]
Testing
If you forked this package, you can test using the command below.
composer test
License
MIT