Conditions | 2 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
34 | public static function fromError(Jid $jid, Error $error, Exception $previous = null) |
||
35 | { |
||
36 | return new static($error, \Kadet\Xmpp\Utils\helper\format("Cannot bind {resource} for {bare}. {condition}", [ |
||
37 | 'resource' => $jid->resource ?: "no resource", |
||
38 | 'bare' => (string)$jid->bare(), |
||
39 | 'condition' => static::_conditionDescription($error) |
||
|
|||
40 | ]), 0, $previous); |
||
41 | } |
||
42 | |||
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: