Skip to content

A versatile, fully-featured Linear Collection implementation.

License

Notifications You must be signed in to change notification settings

galvao-eti/collection

Repository files navigation

GalvaoEti\Collection

A versatile, fully-featured Linear Collection implementation.

Installation

composer require galvao-eti/collection

Features

Features are considered present (ticked) when fully unit tested.

Strongly Typed Collections:

  • Mixed (Default)
  • Integer
  • Double
  • Boolean
  • Array
  • Object
  • Objects of a specific class
  • Overwriting prevention when adding data with existing key or updating
  • Locking the collection (no more writing to it)
  • Deletion
  • Automatically rearranging the collection's keys upon deletion
  • Update items

Usage

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.

License

Apache 2.0

Credits

Created by Er Galvão Abbott [email protected] for Galvão Desenvolvimento de Sistemas.

About

A versatile, fully-featured Linear Collection implementation.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages