1 | <?php |
||
28 | trait QueryTrait |
||
29 | { |
||
30 | /** |
||
31 | * Returns collection of all groups and eager load their tags. |
||
32 | * |
||
33 | * @return Eloquent\Collection |
||
34 | */ |
||
35 | 31 | public function getGroupTags() |
|
47 | |||
48 | /** |
||
49 | * Search tags by name. |
||
50 | * |
||
51 | * @param string $term |
||
52 | * |
||
53 | * @return Eloquent\Collection|static[] |
||
54 | */ |
||
55 | public function searchTags($term) |
||
59 | |||
60 | /** |
||
61 | * Returns tag groups list. |
||
62 | * |
||
63 | * @return array |
||
64 | */ |
||
65 | public function groupsDropdown() |
||
74 | |||
75 | /** |
||
76 | * Returns collection of all groups. |
||
77 | * |
||
78 | * @return Eloquent\Collection |
||
79 | */ |
||
80 | 31 | public function getGroups() |
|
84 | |||
85 | /** |
||
86 | * Return tag by name. |
||
87 | * |
||
88 | * @param string $name |
||
89 | * |
||
90 | * @return static |
||
91 | */ |
||
92 | 7 | public function getTagByName($name) |
|
96 | |||
97 | /** |
||
98 | * Returns collection of tags in status group. |
||
99 | * |
||
100 | * @return Eloquent\Collection |
||
101 | */ |
||
102 | 6 | public function getStatusTags() |
|
106 | |||
107 | /** |
||
108 | * Returns collection of tags in type group. |
||
109 | * |
||
110 | * @return Eloquent\Collection |
||
111 | */ |
||
112 | 2 | public function getTypeTags() |
|
113 | { |
||
114 | 2 | return $this->getTagByName('type')->tags(); |
|
115 | } |
||
116 | |||
117 | /** |
||
118 | * Returns collection of tags in type group. |
||
119 | * |
||
120 | * @return Eloquent\Collection |
||
121 | */ |
||
122 | public function getResolutionTags() |
||
126 | } |
||
127 |
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: