PHP code example of gusarov112 / abstract-collection
1. Go to this page and download the library: Download gusarov112/abstract-collection library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gusarov112 / abstract-collection example snippets
/**
* @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;
}
}