1 | <?php |
||
16 | class SymfonyFramework |
||
17 | { |
||
18 | /** |
||
19 | * @return bool |
||
20 | */ |
||
21 | public static function hasDefinitionSharing() |
||
26 | |||
27 | /** |
||
28 | * @return bool |
||
29 | */ |
||
30 | public static function hasDefinitionScoping() |
||
35 | |||
36 | /** |
||
37 | * @return bool |
||
38 | */ |
||
39 | public static function hasDirectContainerBuilderLogging() |
||
43 | |||
44 | /** |
||
45 | * @param int $major |
||
46 | * @param int|null $minor |
||
47 | * @param int|null $patch |
||
48 | * |
||
49 | * @return bool |
||
50 | */ |
||
51 | public static function isKernelGreaterThanOrEqualTo($major, $minor = null, $patch = null) |
||
55 | |||
56 | /** |
||
57 | * @param int $major |
||
58 | * @param int|null $minor |
||
59 | * @param int|null $patch |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | public static function isKernelLessThan($major, $minor = null, $patch = null) |
||
67 | |||
68 | /** |
||
69 | * @param string $operator |
||
70 | * @param int $major |
||
71 | * @param int|null $minor |
||
72 | * @param int|null $patch |
||
73 | * |
||
74 | * @return bool |
||
75 | */ |
||
76 | private static function kernelVersionCompare($operator, $major, $minor = null, $patch = null) |
||
93 | } |
||
94 |
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: