Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
45 | public static function create($descriptor = null, $basePath = null) |
||
46 | { |
||
47 | static::isZipPresent(); |
||
48 | $descriptor = Utils::objectify($descriptor); |
||
49 | if ($descriptor && !isset($descriptor->resources)) { |
||
50 | $descriptor->resources = []; |
||
51 | } |
||
52 | $packageClass = Factory::getDatapackageClass($descriptor); |
||
53 | |||
54 | return new $packageClass($descriptor, $basePath, true); |
||
55 | } |
||
56 | |||
67 |
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: