A versatile, fully-featured Linear Collection implementation.
composer require galvao-eti/collection:0.3.0-alpha
Features are considered present (ticked) when fully unit tested.
Strongly Typed Collections:
- Mixed (Default)
- Integer
- Double
- Boolean
- Array
- Object
- Objects of a specific class
- Customizable overwriting prevention
- Locking the collection (no more writing to it)
- Deletion
- Automatically rearranging the collection's keys upon deletion
- Update items
Example usage:
<?php
require 'vendor/autoload.php';
use GalvaoEti\Collection\Collection;
$collection = new Collection('string');
$collection->add('foo');
$collection->add('bar', false);
foreach ($collection->generateData() as $item) {
echo "$item<br>";
}
See the bin/useCollection.php script for a more in-depth example.
Apache 2.0
Created by Er Galvão Abbott galvao@php.net for Galvão Desenvolvimento de Sistemas.