typomedia / collection
Basic Collection Class
1.0.4
2022-02-18 07:15 UTC
Requires
- php: >=7.2
Requires (Dev)
- phpmd/phpmd: ^2.8
- phpunit/phpunit: ^8.5
- squizlabs/php_codesniffer: ^3.6
README
Ease of use collection class. 100% Code Coverage in Tests.
The Library is PSR-1, PSR-4, PSR-12 compliant.
Requirements
>= PHP 7.2
Dependencies
none
Install
composer require typomedia/collection
Usage
use Typomedia\Collection\Collection; $data = [ 'Moretti' => [ 'name' => 'Style Ale', 'style' => 'European Amber Lager', 'alcohol' => '9.1%' ] ]; $collection = new Collection(); $key = md5(serialize($data)); $collection->set((object)$data, $key); $collection->get($key); $collection->first(); $collection->last(); $collection->keys(); $collection->find('name', 'Style Ale'); $collection->delete($key);