| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2.0185 |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 | } |
||
| 60 |