Conditions | 4 |
Paths | 6 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 4.8437 |
Changes | 0 |
1 | <?php |
||
54 | 24 | public function __invoke(Container $container) |
|
55 | { |
||
56 | // constructor injection |
||
57 | 24 | $instance = $this->arguments instanceof Arguments ? (new \ReflectionClass($this->class))->newInstanceArgs($this->arguments->inject($container)) : new $this->class; |
|
58 | |||
59 | // setter injection |
||
60 | 24 | ($this->setterMethods)($instance, $container); |
|
61 | |||
62 | // bind dependency injected interceptors |
||
63 | 24 | if (! $this->bind instanceof AspectBind) { |
|
64 | 24 | return $instance; |
|
65 | } |
||
66 | if (! property_exists($instance, 'bindings')) { |
||
67 | throw new \LogicException; // @codeCoverageIgnore |
||
68 | } |
||
69 | $instance->bindings = $this->bind->inject($container); |
||
70 | } |
||
71 | |||
90 |