1 | <?php |
||
9 | class Menu extends BaseMenu |
||
10 | { |
||
11 | use Macroable; |
||
12 | |||
13 | /** |
||
14 | * Set all relevant children active based on the current request's URL. |
||
15 | * |
||
16 | * /, /about, /contact => request to /about will set the about link active. |
||
17 | * |
||
18 | * /en, /en/about, /en/contact => request to /en won't set /en active if the |
||
19 | * request root is set to /en. |
||
20 | * |
||
21 | * @param string $requestRoot If the link's URL is an exact match with the |
||
22 | * request root, the link won't be set active. |
||
23 | * This behavior is to avoid having home links |
||
24 | * active on every request. |
||
25 | * |
||
26 | * @return $this |
||
27 | */ |
||
28 | public function setActiveFromRequest(string $requestRoot = '') |
||
32 | |||
33 | /** |
||
34 | * @param string $path |
||
35 | * @param string $text |
||
36 | * @param array $parameters |
||
37 | * @param bool|null $secure |
||
38 | * |
||
39 | * @return $this |
||
40 | */ |
||
41 | public function url(string $path, string $text, array $parameters = [], $secure = null) |
||
45 | |||
46 | /** |
||
47 | * @param string $action |
||
48 | * @param string $text |
||
49 | * @param array $parameters |
||
50 | * @param bool $absolute |
||
51 | * |
||
52 | * @return $this |
||
53 | */ |
||
54 | public function action(string $action, string $text, array $parameters = [], bool $absolute = true) |
||
58 | |||
59 | /** |
||
60 | * @param string $name |
||
61 | * @param string $text |
||
62 | * @param array $parameters |
||
63 | * @param bool $absolute |
||
64 | * @param \Illuminate\Routing\Route|null $route |
||
65 | * |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function route(string $name, string $text, array $parameters = [], bool $absolute = true, $route = null) |
||
72 | |||
73 | /** |
||
74 | * @param bool $condition |
||
75 | * @param string $path |
||
76 | * @param string $text |
||
77 | * @param array $parameters |
||
78 | * @param bool|null $secure |
||
79 | * |
||
80 | * @return $this |
||
81 | */ |
||
82 | public function urlIf($condition, string $path, string $text, array $parameters = [], $secure = null) |
||
86 | |||
87 | /** |
||
88 | * @param bool $condition |
||
89 | * @param string $action |
||
90 | * @param string $text |
||
91 | * @param array $parameters |
||
92 | * @param bool $absolute |
||
93 | * |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function actionIf($condition, string $action, string $text, array $parameters = [], bool $absolute = true) |
||
100 | |||
101 | /** |
||
102 | * @param bool $condition |
||
103 | * @param string $name |
||
104 | * @param string $text |
||
105 | * @param array $parameters |
||
106 | * @param bool $absolute |
||
107 | * @param \Illuminate\Routing\Route|null $route |
||
108 | * |
||
109 | * @return $this |
||
110 | */ |
||
111 | public function routeIf($condition, string $name, string $text, array $parameters = [], bool $absolute = true, $route = null) |
||
115 | |||
116 | /** |
||
117 | * @param string|array $authorization |
||
118 | * @param \Spatie\Menu\Laravel\Item $item |
||
119 | * |
||
120 | * @return $this |
||
121 | */ |
||
122 | public function addIfCan($authorization, Item $item) |
||
129 | |||
130 | /** |
||
131 | * @param string|array $authorization |
||
132 | * @param string $url |
||
133 | * @param string $text |
||
134 | * |
||
135 | * @return $this |
||
136 | */ |
||
137 | public function linkIfCan($authorization, string $url, string $text) |
||
141 | |||
142 | /** |
||
143 | * @param string|array $authorization |
||
144 | * @param string $html |
||
145 | * |
||
146 | * @return \Spatie\Menu\Laravel\Menu |
||
147 | */ |
||
148 | public function htmlIfCan($authorization, string $html) |
||
152 | |||
153 | /** |
||
154 | * @param string|array $authorization |
||
155 | * @param string $path |
||
156 | * @param string $text |
||
157 | * @param array $parameters |
||
158 | * @param bool|null $secure |
||
159 | * |
||
160 | * @return $this |
||
161 | */ |
||
162 | public function urlIfCan($authorization, string $path, string $text, array $parameters = [], $secure = null) |
||
166 | |||
167 | /** |
||
168 | * @param string|array $authorization |
||
169 | * @param string $action |
||
170 | * @param string $text |
||
171 | * @param array $parameters |
||
172 | * @param bool $absolute |
||
173 | * |
||
174 | * @return $this |
||
175 | */ |
||
176 | public function actionIfCan($authorization, string $action, string $text, array $parameters = [], bool $absolute = true) |
||
180 | |||
181 | /** |
||
182 | * @param string|array $authorization |
||
183 | * @param string $name |
||
184 | * @param string $text |
||
185 | * @param array $parameters |
||
186 | * @param bool $absolute |
||
187 | * @param \Illuminate\Routing\Route|null $route |
||
188 | * |
||
189 | * @return $this |
||
190 | */ |
||
191 | public function routeIfCan($authorization, string $name, string $text, array $parameters = [], bool $absolute = true, $route = null) |
||
195 | } |
||
196 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: