| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | public function getCountryByName($countryName) |
||
| 49 | { |
||
| 50 | $countryCode = $this->countryNameConverter->convertToCode($countryName); |
||
| 51 | $country = $this->countryRepository->findOneBy(['code' => $countryCode]); |
||
| 52 | |||
| 53 | if (null === $country) { |
||
| 54 | throw new \InvalidArgumentException(sprintf('Country with name %s does not exist', $countryName)); |
||
| 55 | } |
||
| 56 | |||
| 57 | return $country; |
||
| 58 | } |
||
| 59 | } |
||
| 60 |