PHP code example of emagister / collections
1. Go to this page and download the library: Download emagister/collections 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/ */
emagister / collections example snippets
/** @extends SpecificCollection<ConcreteObject> */
final class ConcreteObjectCollection extends SpecificCollection
{
public function __construct(array $elements = [])
{
parent::__construct(ConcreteObject::class, $elements);
}
}
protected function createSequence(array $elements): static
{
return new static($this->type(), $elements, $this->logger);
}