| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 7 | private function findByShortCode(EntityManagerInterface $em, string $shortCode): ShortUrl |
|
| 18 | { |
||
| 19 | /** @var ShortUrl|null $shortUrl */ |
||
| 20 | 7 | $shortUrl = $em->getRepository(ShortUrl::class)->findOneBy([ |
|
| 21 | 7 | 'shortCode' => $shortCode, |
|
| 22 | ]); |
||
| 23 | 7 | if ($shortUrl === null) { |
|
| 24 | 1 | throw InvalidShortCodeException::fromNotFoundShortCode($shortCode); |
|
| 25 | } |
||
| 26 | |||
| 27 | 6 | return $shortUrl; |
|
| 28 | } |
||
| 29 | } |
||
| 30 |