| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function findOrLog(string $code): ?MediaInterface |
||
| 34 | { |
||
| 35 | $media = $this->mediaRepository->findOneEnabledByCode($code); |
||
| 36 | |||
| 37 | if (false === $media instanceof MediaInterface) { |
||
| 38 | $this->logger->warning(sprintf( |
||
| 39 | 'Media with "%s" code was not found in the database.', |
||
| 40 | $code |
||
| 41 | )); |
||
| 42 | |||
| 43 | return null; |
||
| 44 | } |
||
| 45 | |||
| 46 | return $media; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |