1 | <?php |
||
16 | class RouteCollection extends Collection |
||
17 | { |
||
18 | /* ----------------------------------------------------------------- |
||
19 | | Main Methods |
||
20 | | ----------------------------------------------------------------- |
||
21 | */ |
||
22 | |||
23 | /** |
||
24 | * Load the routes. |
||
25 | * |
||
26 | * @param array $routes |
||
27 | * @param array $excludedUris |
||
28 | * @param array $excludedMethods |
||
29 | * @param array $methodColors |
||
30 | * |
||
31 | * @return $this |
||
32 | */ |
||
33 | 8 | public static function load( |
|
51 | |||
52 | /* ----------------------------------------------------------------- |
||
53 | | Other Methods |
||
54 | | ----------------------------------------------------------------- |
||
55 | */ |
||
56 | |||
57 | /** |
||
58 | * Prepare route methods. |
||
59 | * |
||
60 | * @param \Illuminate\Routing\Route $route |
||
61 | * @param array $excluded |
||
62 | * @param array $colors |
||
63 | * |
||
64 | * @return array |
||
65 | */ |
||
66 | 8 | private static function prepareMethods(IlluminateRoute $route, array $excluded, array $colors) |
|
75 | |||
76 | /** |
||
77 | * Prepare route middleware. |
||
78 | * |
||
79 | * @param \Illuminate\Routing\Route $route |
||
80 | * |
||
81 | * @return array |
||
82 | */ |
||
83 | 8 | private static function prepareMiddleware(IlluminateRoute $route): array |
|
89 | |||
90 | /** |
||
91 | * Gather all the route middleware. |
||
92 | * |
||
93 | * @param \Illuminate\Routing\Route $route |
||
94 | * |
||
95 | * @return array |
||
96 | */ |
||
97 | 8 | private static function gatherMiddleware(IlluminateRoute $route): array |
|
106 | } |
||
107 |
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: