1 | <?php namespace Arcanedev\RouteViewer\Entities; |
||
14 | class RouteCollection extends Collection |
||
15 | { |
||
16 | /* ------------------------------------------------------------------------------------------------ |
||
17 | | Main Functions |
||
18 | | ------------------------------------------------------------------------------------------------ |
||
19 | */ |
||
20 | /** |
||
21 | * Load the routes. |
||
22 | * |
||
23 | * @param array $routes |
||
24 | * @param array $excludedUris |
||
25 | * @param array $excludedMethods |
||
26 | * @param array $methodColors |
||
27 | * |
||
28 | * @return self |
||
29 | */ |
||
30 | 27 | public static function load( |
|
48 | |||
49 | /** |
||
50 | * Prepare route methods. |
||
51 | * |
||
52 | * @param \Illuminate\Routing\Route $route |
||
53 | * @param array $excluded |
||
54 | * @param array $colors |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | 27 | private static function prepareMethods(IlluminateRoute $route, array $excluded, array $colors) |
|
67 | |||
68 | /** |
||
69 | * Prepare route middleware. |
||
70 | * |
||
71 | * @param \Illuminate\Routing\Route $route |
||
72 | * |
||
73 | * @return array |
||
74 | */ |
||
75 | 27 | private static function prepareMiddleware(IlluminateRoute $route) |
|
81 | 27 | ||
82 | /** |
||
83 | 27 | * Gather all the route middleware. |
|
84 | 27 | * |
|
85 | 27 | * @param \Illuminate\Routing\Route $route |
|
86 | * |
||
87 | * @return array |
||
88 | */ |
||
89 | private static function gatherMiddleware(IlluminateRoute $route) |
||
98 | } |
||
99 |
Let’s assume you have a class which uses late-static binding:
}
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()
on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClass
to useself
instead: