| Total Complexity | 3 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class InjectingProviderProvider implements ProviderInterface |
||
| 12 | { |
||
| 13 | /** @var InjectionPointInterface */ |
||
| 14 | private $ip; |
||
| 15 | |||
| 16 | /** @var InjectorInterface */ |
||
| 17 | private $injector; |
||
| 18 | |||
| 19 | public function __construct(InjectionPointInterface $ip, InjectorInterface $injector) |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return mixed |
||
| 27 | */ |
||
| 28 | public function get() |
||
| 29 | { |
||
| 30 | $set = $this->ip->getParameter()->getAttributes(Set::class)[0]; |
||
| 31 | $instance = $set->newInstance(); |
||
| 32 | assert($instance instanceof Set); |
||
| 33 | |||
| 34 | return new class ($this->injector, $instance) implements ProviderInterface |
||
| 35 | { |
||
| 36 | /** @var InjectorInterface */ |
||
| 37 | private $injector; |
||
| 38 | |||
| 39 | /** @var Set */ |
||
| 40 | private $set; |
||
| 41 | |||
| 42 | public function __construct(InjectorInterface $injector, Set $set) |
||
| 43 | { |
||
| 44 | $this->injector = $injector; |
||
| 45 | $this->set = $set; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return mixed |
||
| 50 | */ |
||
| 51 | public function get() |
||
| 54 | } |
||
| 55 | }; |
||
| 56 | } |
||
| 58 |