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
CollectionIndexedFactory
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\CollectionFactoryInterface;
8use pvc\interfaces\struct\collection\CollectionInterface;
9use pvc\interfaces\struct\collection\IndexedElementInterface;
10
11/**
12 * @template ElementType of IndexedElementInterface
13 * @implements CollectionFactoryInterface<ElementType>
14 */
15class CollectionIndexedFactory implements CollectionFactoryInterface
16{
17    /**
18     * @param array<non-negative-int, ElementType> $elements
19     * @return CollectionInterface<ElementType>
20     */
21    public function makeCollection(array $elements = []): CollectionInterface
22    {
23        return new CollectionIndexed($elements);
24    }
25}