Passed
Push — provider-serialisable ( f6f39e...4a5009 )
by Akihito
10:38
created

ProviderProvider::get()   A

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
final class ProviderProvider implements ProviderInterface
10
{
11
    /** @var InjectorInterface  */
12
    private $injector;
13
14
    /** @var InjectorInterface */
15
    private $interface;
16
17
    /** @var Set */
18
    private $set;
19
20
    public function __construct(InjectorInterface $injector, Set $set)
21
    {
22
        $this->injector = $injector;
23
        $this->set = $set;
24
    }
25
26
    public function get()
27
    {
28
        return $this->injector->getInstance($this->set->interface, $this->set->name);
29
    }
30
}
31