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