Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function notifyAdminBlock($type) |
||
34 | { |
||
35 | /** @var \HookAdminBlockObserverInterface $observer */ |
||
36 | // Save data |
||
37 | if (isset($this->eventData['blocks'])) { |
||
38 | $this->eventData['type'] = $type; |
||
39 | // Call all registered hook observers for admin block |
||
40 | foreach ($this->observers as $observer) { |
||
41 | $data = $observer->hookAdminBlock($this); |
||
42 | if (isset($data['blocks'])) { |
||
43 | // Get modified data |
||
44 | $this->eventData['blocks'] = $data['blocks']; |
||
45 | } |
||
46 | } |
||
47 | |||
48 | return $this->eventData; |
||
|
|||
49 | } |
||
50 | |||
51 | return 0; |
||
52 | } |
||
54 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: