| Total Lines | 23 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function get() |
||
| 26 | { |
||
| 27 | $set = $this->ip->getParameter()->getAttributes(Set::class)[0]; |
||
| 28 | $instance = $set->newInstance(); |
||
| 29 | assert($instance instanceof Set); |
||
| 30 | |||
| 31 | return new class ($this->injector, $instance) implements ProviderInterface |
||
| 32 | { |
||
| 33 | private InjectorInterface $injector; |
||
| 34 | private Set $set; |
||
| 35 | |||
| 36 | public function __construct(InjectorInterface $injector, Set $set) |
||
| 37 | { |
||
| 38 | $this->injector = $injector; |
||
| 39 | $this->set = $set; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return mixed |
||
| 44 | */ |
||
| 45 | public function get() |
||
| 46 | { |
||
| 47 | return $this->injector->getInstance($this->set->interface, $this->set->name); |
||
| 48 | } |
||
| 52 |