Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
42 | public static function fromArray(array $objectArray) |
||
43 | { |
||
44 | |||
45 | $object = (object) static::hydratePreprocess($objectArray); |
||
46 | try { |
||
47 | return static::getTransmapper()->map($object, static::class); |
||
48 | } catch (Exception $exception) { |
||
49 | throw new ClientException($exception->getMessage(), $exception->getCode(), $exception); |
||
50 | } |
||
51 | } |
||
52 | |||
62 |
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: