Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function execute(BlockContextInterface $blockContext, Response $response = null) |
||
21 | { |
||
22 | $eventBlock = $blockContext->getSetting('event_block'); |
||
23 | |||
24 | if (!$eventBlock instanceof EventBlock) { |
||
25 | return new NotFoundHttpException(); |
||
|
|||
26 | } |
||
27 | |||
28 | return $this->renderResponse($blockContext->getTemplate(), [ |
||
29 | 'block' => $blockContext->getBlock(), |
||
30 | 'event_block' => $eventBlock, |
||
31 | ], $response); |
||
32 | } |
||
46 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: