1 | <?php |
||
8 | class UriParameters |
||
9 | { |
||
10 | /** |
||
11 | * Replace route parameters. |
||
12 | * |
||
13 | * @param $uri |
||
14 | * @param array $parameters |
||
15 | * |
||
16 | * @return mixed|string |
||
17 | */ |
||
18 | 4 | public static function replace($uri, $parameters = []) |
|
27 | |||
28 | /** |
||
29 | * Replace all of the wildcard parameters for a route path. |
||
30 | * |
||
31 | * @note: taken from the Illuminate\Routing\UrlGenerator code |
||
32 | * |
||
33 | * @param string $path |
||
34 | * @param array $parameters |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | 4 | private static function replaceRouteParameters($path, array $parameters) |
|
50 | |||
51 | /** |
||
52 | * Replace all of the named parameters in the path. |
||
53 | * |
||
54 | * @note: taken from the Illuminate\Routing\UrlGenerator code |
||
55 | * |
||
56 | * @param string $path |
||
57 | * @param array $parameters |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | private static function replaceNamedParameters($path, &$parameters) |
||
67 | } |
||
68 |
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: