1 | <?php |
||
16 | class RouteServiceProvider extends ServiceProvider |
||
17 | { |
||
18 | /* ----------------------------------------------------------------- |
||
19 | | Main Methods |
||
20 | | ----------------------------------------------------------------- |
||
21 | */ |
||
22 | |||
23 | /** |
||
24 | * Boot the service provider. |
||
25 | */ |
||
26 | 48 | public function boot(): void |
|
27 | { |
||
28 | 48 | if ($this->isEnabled()) { |
|
29 | 48 | $this->routes(function () { |
|
30 | 24 | static::mapRouteClasses([RouteViewerRoutes::class]); |
|
|
|||
31 | 48 | }); |
|
32 | } |
||
33 | 48 | } |
|
34 | |||
35 | /* ----------------------------------------------------------------- |
||
36 | | Check Methods |
||
37 | | ----------------------------------------------------------------- |
||
38 | */ |
||
39 | |||
40 | /** |
||
41 | * Check if routes is enabled. |
||
42 | * |
||
43 | * @return bool |
||
44 | */ |
||
45 | 48 | public function isEnabled(): bool |
|
49 | } |
||
50 |
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: