| Conditions | 4 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function execute(BlockContextInterface $blockContext, Response $response = null) |
||
| 22 | { |
||
| 23 | $event = $blockContext->getSetting('event'); |
||
| 24 | |||
| 25 | if (!$event instanceof Event) { |
||
| 26 | return new NotFoundHttpException(); |
||
|
|
|||
| 27 | } |
||
| 28 | |||
| 29 | $about = $event->getAbout(); |
||
| 30 | if (!$about) { |
||
| 31 | $eventBlock = $blockContext->getSetting('event_block'); |
||
| 32 | |||
| 33 | if ($eventBlock instanceof EventBlock) { |
||
| 34 | $about = $eventBlock->getText(); |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | return $this->renderResponse($blockContext->getTemplate(), [ |
||
| 39 | 'block' => $blockContext->getBlock(), |
||
| 40 | 'settings' => $blockContext->getSettings(), |
||
| 41 | 'event' => $event, |
||
| 42 | 'about' => $about, |
||
| 43 | ], $response); |
||
| 44 | } |
||
| 58 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: