gusarov112/abstract-collection

A simple abstract class mostly for entities, models, value objects

v1.0.3 2020-07-13 08:18 UTC

This package is auto-updated.

Last update: 2024-09-19 04:58:19 UTC


README

Installation

Require package

composer require gusarov112/abstract-collection

Usage

This is just recommendation how to use and how to implement.

/**
 * @method Bar[] getIterator()
 */
class BarCollection extends \Gusarov112\AbstractCollection\AbstractCollection
{
    public function __construct(Bar ...$items)
    {
        $this->items = $items;
    }

    public function addItem(Bar $item)
    {
        $this->items[] = $item;
    }
}

@TODO

  1. Write tests
  2. Make SplFixedArray benchmark again and post results in readme