| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | public function findOrLog(string $code): ?BlockInterface |
||
| 46 | { |
||
| 47 | $block = $this->blockRepository->findEnabledByCode($code); |
||
| 48 | |||
| 49 | if (false === $block instanceof BlockInterface) { |
||
| 50 | $this->logger->warning(sprintf( |
||
| 51 | 'Block with "%s" code was not found in the database.', |
||
| 52 | $code |
||
| 53 | )); |
||
| 54 | |||
| 55 | return null; |
||
| 56 | } |
||
| 57 | |||
| 58 | return $block; |
||
| 59 | } |
||
| 60 | } |