Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
ArrayToDoctrineCollection | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
convert | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | namespace Apie\Core\TypeConverters; |
3 | |
4 | use Apie\TypeConverter\ConverterInterface; |
5 | use Doctrine\Common\Collections\ArrayCollection; |
6 | use Doctrine\Common\Collections\Collection; |
7 | |
8 | /** |
9 | * @template T |
10 | * @implements ConverterInterface<array<int, T>, Collection<int, T>> |
11 | */ |
12 | class ArrayToDoctrineCollection implements ConverterInterface |
13 | { |
14 | /** |
15 | * @param array<int, T> $input |
16 | * @return Collection<int, T> |
17 | */ |
18 | public function convert(array $input): Collection |
19 | { |
20 | return new ArrayCollection($input); |
21 | } |
22 | } |