1 | <?php |
||
2 | |||
3 | namespace SleepingOwl\Admin\Widgets; |
||
4 | |||
5 | use Illuminate\Contracts\View\View; |
||
6 | use SleepingOwl\Admin\Contracts\Widgets\WidgetInterface; |
||
7 | |||
8 | abstract class Widget implements WidgetInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var \Illuminate\View\View |
||
12 | */ |
||
13 | protected $view; |
||
14 | |||
15 | /** |
||
16 | * @return bool |
||
17 | */ |
||
18 | 285 | public function active() |
|
19 | { |
||
20 | 285 | return true; |
|
21 | } |
||
22 | |||
23 | /** |
||
24 | * @return int |
||
25 | */ |
||
26 | public function position() |
||
27 | { |
||
28 | return 0; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param View $view |
||
33 | */ |
||
34 | public function setInjectableView(View $view) |
||
35 | { |
||
36 | $this->view = $view; |
||
0 ignored issues
–
show
|
|||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return array |
||
41 | */ |
||
42 | public function toArray() |
||
43 | { |
||
44 | return [ |
||
45 | 'block' => $this->block(), |
||
46 | 'template' => $this->template(), |
||
47 | 'html' => $this->toHtml(), |
||
48 | 'position' => $this->position(), |
||
49 | ]; |
||
50 | } |
||
51 | } |
||
52 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.