Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
CollectionOrderedByIndexFactory
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 makeCollection
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace pvc\struct\collection;
6
7use pvc\interfaces\struct\collection\CollectionOrderedByIndexFactoryInterface;
8use pvc\interfaces\struct\collection\IndexedElementInterface;
9
10/**
11 * @template ElementType of IndexedElementInterface
12 * @implements CollectionOrderedByIndexFactoryInterface<ElementType, CollectionOrderedByIndex>
13 */
14class CollectionOrderedByIndexFactory implements CollectionOrderedByIndexFactoryInterface
15{
16    /**
17     * @param  array<non-negative-int, ElementType>  $elements
18     *
19     * @return CollectionOrderedByIndex<ElementType>
20     */
21    public function makeCollection(array $elements = []): CollectionOrderedByIndex
22    {
23        return new CollectionOrderedByIndex($elements);
24    }
25}