Conditions | 3 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
13 | 18 | private function createInjector(/*object */$target): \Closure |
|
14 | { |
||
15 | $injector = function (string $property, /*object */$object): void { |
||
16 | 18 | if (\property_exists($this, $property) && null === $this->$property) { |
|
17 | 16 | $this->$property = $object; |
|
18 | } |
||
19 | 18 | }; |
|
20 | |||
21 | 18 | return $injector->bindTo($target, \get_class($target)); |
|
22 | } |
||
24 |