ProviderProvider::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\Di;
6
7
use Ray\Di\Di\Set;
8
9
/**
10
 * @implements ProviderInterface<mixed>
11
 * @template T of object
12
 */
13
final class ProviderProvider implements ProviderInterface
14
{
15
    /** @param Set<T> $set */
16
    public function __construct(private InjectorInterface $injector, private Set $set)
17
    {
18
    }
19
20
    /** @return mixed */
21
    public function get()
22
    {
23
        return $this->injector->getInstance($this->set->interface, $this->set->name);
24
    }
25
}
26