1 | <?php |
||
8 | class TagWidget |
||
9 | { |
||
10 | /** |
||
11 | * @var TagRepository |
||
12 | */ |
||
13 | private $tag; |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $namespace; |
||
18 | /** |
||
19 | * @var TaggableInterface|null |
||
20 | */ |
||
21 | private $entity; |
||
22 | /** |
||
23 | * @var string|null |
||
24 | */ |
||
25 | private $view; |
||
26 | |||
27 | public function __construct(TagRepository $tag) |
||
31 | |||
32 | /** |
||
33 | * @param $arguments |
||
34 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
35 | */ |
||
36 | public function show($arguments) |
||
48 | |||
49 | /** |
||
50 | * Extract the possible arguments as class properties |
||
51 | * @param array $arguments |
||
52 | */ |
||
53 | private function extractArguments(array $arguments) |
||
59 | |||
60 | /** |
||
61 | * Get the available tags, if an entity is available from that |
||
62 | * @return array |
||
63 | */ |
||
64 | private function getTags() |
||
72 | } |
||
73 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: