1 | <?php |
||
16 | class SymfonyFramework |
||
17 | { |
||
18 | /** |
||
19 | * @return bool |
||
20 | */ |
||
21 | public static function hasDirectContainerBuilderLogging(): bool |
||
25 | |||
26 | /** |
||
27 | * @return string |
||
28 | */ |
||
29 | public static function getContainerResolvableRootWebPath(): string |
||
33 | |||
34 | /** |
||
35 | * @param int $major |
||
36 | * @param int|null $minor |
||
37 | * @param int|null $patch |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | public static function isKernelGreaterThanOrEqualTo(int $major, int $minor = null, int $patch = null): bool |
||
45 | |||
46 | /** |
||
47 | * @param int $major |
||
48 | * @param int|null $minor |
||
49 | * @param int|null $patch |
||
50 | * |
||
51 | * @return bool |
||
52 | */ |
||
53 | public static function isKernelLessThan(int $major, int $minor = null, int $patch = null): bool |
||
57 | |||
58 | /** |
||
59 | * @param string $operator |
||
60 | * @param int $major |
||
61 | * @param int|null $minor |
||
62 | * @param int|null $patch |
||
63 | * |
||
64 | * @return bool |
||
65 | */ |
||
66 | private static function kernelVersionCompare(string $operator, int $major, int $minor = null, int $patch = null): bool |
||
70 | } |
||
71 |
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: