Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | 3 | private static function completeHelpMessage($serviceId) |
|
17 | { |
||
18 | $helpMessages = [ |
||
19 | 3 | Middleware\ValidatorMiddleware::SERVICE_ID => 'You should have the symfony validator service enabled to use this middleware.', |
|
20 | 3 | Middleware\SecurityMiddleware::SERVICE_ID => 'You should have the symfony security service enabled to use this middleware.', |
|
21 | 2 | ]; |
|
22 | |||
23 | 3 | if (array_key_exists($serviceId, $helpMessages)) { |
|
24 | 3 | return $helpMessages[$serviceId]; |
|
25 | } |
||
26 | } |
||
27 | } |
||
28 |
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: