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 | * @var string|null |
||
28 | */ |
||
29 | private $name; |
||
30 | |||
31 | public function __construct(TagRepository $tag) |
||
35 | |||
36 | /** |
||
37 | * @param $arguments |
||
38 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
39 | */ |
||
40 | public function show($arguments) |
||
54 | |||
55 | /** |
||
56 | * Extract the possible arguments as class properties |
||
57 | * @param array $arguments |
||
58 | */ |
||
59 | private function extractArguments(array $arguments) |
||
66 | |||
67 | /** |
||
68 | * Get the available tags, if an entity is available from that |
||
69 | * @return array |
||
70 | */ |
||
71 | private function getTags() |
||
79 | } |
||
80 |
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: