| Total Lines | 23 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 | private InjectorInterface $injector; |
||
| 37 | private Set $set; |
||
| 38 | |||
| 39 | public function __construct(InjectorInterface $injector, Set $set) |
||
| 40 | { |
||
| 41 | $this->injector = $injector; |
||
| 42 | $this->set = $set; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return mixed |
||
| 47 | */ |
||
| 48 | public function get() |
||
| 49 | { |
||
| 50 | return $this->injector->getInstance($this->set->interface, $this->set->name); |
||
| 51 | } |
||
| 55 |