1 | <?php |
||
16 | class RouteViewer implements RouteViewerContract |
||
17 | { |
||
18 | /* ----------------------------------------------------------------- |
||
19 | | Properties |
||
20 | | ----------------------------------------------------------------- |
||
21 | */ |
||
22 | |||
23 | /** |
||
24 | * The router instance. |
||
25 | * |
||
26 | * @var \Illuminate\Routing\Router |
||
27 | */ |
||
28 | private $router; |
||
29 | |||
30 | /** |
||
31 | * The config repository. |
||
32 | * |
||
33 | * @var \Illuminate\Contracts\Config\Repository |
||
34 | */ |
||
35 | private $config; |
||
36 | |||
37 | /** |
||
38 | * The route collection. |
||
39 | * |
||
40 | * @var \Arcanedev\RouteViewer\Entities\RouteCollection |
||
41 | */ |
||
42 | protected $routes; |
||
43 | |||
44 | /* ----------------------------------------------------------------- |
||
45 | | Constructor |
||
46 | | ----------------------------------------------------------------- |
||
47 | */ |
||
48 | |||
49 | /** |
||
50 | * RouteViewer constructor. |
||
51 | * |
||
52 | * @param \Illuminate\Contracts\Routing\Registrar $router |
||
53 | * @param \Illuminate\Contracts\Config\Repository $config |
||
54 | */ |
||
55 | 12 | public function __construct(Router $router, Config $config) |
|
60 | |||
61 | /* ----------------------------------------------------------------- |
||
62 | | Main Methods |
||
63 | | ----------------------------------------------------------------- |
||
64 | */ |
||
65 | |||
66 | /** |
||
67 | * Get all routes. |
||
68 | * |
||
69 | * @return \Arcanedev\RouteViewer\Entities\RouteCollection |
||
70 | */ |
||
71 | 8 | public function all() |
|
84 | |||
85 | /** |
||
86 | * Get the excluded URIs. |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | 8 | public function getExcludedUris(): array |
|
94 | |||
95 | /** |
||
96 | * Get the excluded methods. |
||
97 | * |
||
98 | * @return array |
||
99 | */ |
||
100 | 8 | public function getExcludedMethods(): array |
|
104 | |||
105 | /** |
||
106 | * Get method colors. |
||
107 | * |
||
108 | * @return array |
||
109 | */ |
||
110 | 8 | private function getMethodColors(): array |
|
121 | |||
122 | /* ----------------------------------------------------------------- |
||
123 | | Other Methods |
||
124 | | ----------------------------------------------------------------- |
||
125 | */ |
||
126 | |||
127 | /** |
||
128 | * Get a config value. |
||
129 | * |
||
130 | * @param string $key |
||
131 | * @param mixed|null $default |
||
132 | * |
||
133 | * @return mixed |
||
134 | */ |
||
135 | 8 | private function getConfig(string $key, $default = null) |
|
139 | } |
||
140 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.