Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
43 | private static function _conditionDescription(Error $error) |
||
44 | { |
||
45 | if(!empty($error->text)) { |
||
46 | return $error->text; |
||
47 | } |
||
48 | |||
49 | return [ |
||
50 | 'bad-request' => 'Bad Request: "{resource}" is not valid XMPP resource identifier.', |
||
51 | 'conflict' => 'Conflict: {bare}/{resource} is already in use.' |
||
52 | ][$error->condition] ?? 'Unknown reason: '.$error->condition; |
||
53 | } |
||
54 | } |
||
55 |
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: