1 | <?php |
||
12 | class Link implements Item, HasHtmlAttributes, HasParentAttributes, Activatable |
||
13 | { |
||
14 | use ActivatableTrait, HasHtmlAttributesTrait, HasParentAttributesTrait, ConditionsTrait, HasAttributesTrait; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $text; |
||
18 | |||
19 | /** @var string|null */ |
||
20 | protected $url = null; |
||
21 | |||
22 | /** @var string */ |
||
23 | protected $prepend, $append = ''; |
||
24 | |||
25 | /** @var bool */ |
||
26 | protected $active = false; |
||
27 | |||
28 | /** @var \Spatie\Menu\Html\Attributes */ |
||
29 | protected $htmlAttributes, $parentAttributes; |
||
30 | |||
31 | /** |
||
32 | * @param string $url |
||
33 | * @param string $text |
||
34 | */ |
||
35 | protected function __construct(string $url, string $text) |
||
42 | |||
43 | /** |
||
44 | * @param string $url |
||
45 | * @param string $text |
||
46 | * |
||
47 | * @return static |
||
48 | */ |
||
49 | public static function to(string $url, string $text) |
||
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | public function text(): string |
||
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | public function render(): string |
||
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | public function __toString(): string |
||
80 | } |
||
81 |
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: