Total Complexity | 7 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 87.5% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | class ConversionCollection extends AbstractCollection |
||
12 | { |
||
13 | 1 | public function getByName(string $name): Conversion |
|
14 | { |
||
15 | $conversion = $this->first(function (Conversion $conversion) use ($name) { |
||
16 | 1 | return $conversion->getName() === $name; |
|
17 | 1 | }); |
|
18 | |||
19 | 1 | if (!$conversion) { |
|
20 | throw InvalidConversion::unknownName($name); |
||
21 | } |
||
22 | |||
23 | 1 | return $conversion; |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * Get all the conversions in the collection. |
||
28 | * |
||
29 | * @param string $collectionName |
||
30 | * |
||
31 | * @return $this |
||
32 | */ |
||
33 | 4 | public function forCollection(string $collectionName = '') |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * @param string $collectionName |
||
44 | * |
||
45 | * @return $this |
||
46 | */ |
||
47 | 4 | protected function shouldBePerformedOn($collectionName) |
|
60 |