| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 54 | public function newInstance(string $class, array $args) |
||
| 55 | { |
||
| 56 | $aopClass = ($this->aopClassName)($class, $this->bindName); |
||
| 57 | if (! class_exists($aopClass)) { |
||
| 58 | $this->compiler->compile($class, $this->bind); |
||
| 59 | assert(class_exists($aopClass)); |
||
| 60 | } |
||
| 61 | $instance = (new ReflectionClass($aopClass))->newInstanceArgs($args); |
||
| 62 | $instance->bindings = $this->bind->getBindings(); |
||
| 63 | |||
| 64 | return $instance; |
||
| 65 | } |
||
| 66 | |||
| 83 |
Late static binding only has effect in subclasses. A
finalclass cannot be extended anymore so late static binding cannot occurr. Consider replacingstatic::withself::.To learn more about late static binding, please refer to the PHP core documentation.