| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function getZone(string $codeOrName): ZoneInterface |
||
| 39 | { |
||
| 40 | $zone = $this->zoneRepository->findOneBy(['code' => $codeOrName]); |
||
| 41 | if (null !== $zone) { |
||
| 42 | return $zone; |
||
| 43 | } |
||
| 44 | |||
| 45 | $zone = $this->zoneRepository->findOneBy(['name' => $codeOrName]); |
||
| 46 | Assert::notNull( |
||
| 47 | $zone, |
||
| 48 | 'Zone does not exist.' |
||
| 49 | ); |
||
| 50 | |||
| 51 | return $zone; |
||
| 52 | } |
||
| 53 | |||
| 68 |