1 | <?php namespace Arcanedev\RouteViewer; |
||
13 | class RouteViewer implements RouteViewerContract |
||
14 | { |
||
15 | /* ----------------------------------------------------------------- |
||
16 | | Properties |
||
17 | | ----------------------------------------------------------------- |
||
18 | */ |
||
19 | |||
20 | /** |
||
21 | * The router instance. |
||
22 | * |
||
23 | * @var \Illuminate\Routing\Router |
||
24 | */ |
||
25 | private $router; |
||
26 | |||
27 | /** |
||
28 | * The config repository. |
||
29 | * |
||
30 | * @var \Illuminate\Contracts\Config\Repository |
||
31 | */ |
||
32 | private $config; |
||
33 | |||
34 | /** |
||
35 | * The route collection. |
||
36 | * |
||
37 | * @var \Arcanedev\RouteViewer\Entities\RouteCollection |
||
38 | */ |
||
39 | protected $routes; |
||
40 | |||
41 | /* ----------------------------------------------------------------- |
||
42 | | Constructor |
||
43 | | ----------------------------------------------------------------- |
||
44 | */ |
||
45 | |||
46 | /** |
||
47 | * RouteViewer constructor. |
||
48 | * |
||
49 | * @param \Illuminate\Contracts\Routing\Registrar $router |
||
50 | * @param \Illuminate\Contracts\Config\Repository $config |
||
51 | */ |
||
52 | public function __construct(Router $router, Config $config) |
||
57 | |||
58 | /* ----------------------------------------------------------------- |
||
59 | | Main Methods |
||
60 | | ----------------------------------------------------------------- |
||
61 | */ |
||
62 | |||
63 | /** |
||
64 | * Get all routes. |
||
65 | * |
||
66 | * @return \Arcanedev\RouteViewer\Entities\RouteCollection |
||
67 | */ |
||
68 | public function all() |
||
81 | |||
82 | /** |
||
83 | * Get the excluded URIs. |
||
84 | * |
||
85 | * @return array |
||
86 | */ |
||
87 | public function getExcludedUris() |
||
91 | |||
92 | /** |
||
93 | * Get the excluded methods. |
||
94 | * |
||
95 | * @return array |
||
96 | */ |
||
97 | public function getExcludedMethods() |
||
101 | |||
102 | /** |
||
103 | * Get method colors. |
||
104 | * |
||
105 | * @return array |
||
106 | */ |
||
107 | private function getMethodColors() |
||
118 | |||
119 | /* ----------------------------------------------------------------- |
||
120 | | Other Methods |
||
121 | | ----------------------------------------------------------------- |
||
122 | */ |
||
123 | |||
124 | /** |
||
125 | * Get a config value. |
||
126 | * |
||
127 | * @param string $key |
||
128 | * @param mixed|null $default |
||
129 | * |
||
130 | * @return mixed |
||
131 | */ |
||
132 | private function getConfig($key, $default = null) |
||
136 | } |
||
137 |
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.