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