Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | final class Untarget |
||
10 | { |
||
11 | /** |
||
12 | * @phpstan-var ReflectionClass<object> |
||
13 | * @psalm-var ReflectionClass |
||
14 | */ |
||
15 | private $class; |
||
16 | |||
17 | /** @var string */ |
||
18 | private $scope = Scope::PROTOTYPE; |
||
19 | |||
20 | /** |
||
21 | * @param class-string $class |
||
|
|||
22 | */ |
||
23 | public function __construct(string $class) |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Bind untargeted binding |
||
30 | */ |
||
31 | public function __invoke(Container $container, Bind $bind): void |
||
32 | { |
||
33 | $bound = (new DependencyFactory())->newAnnotatedDependency($this->class); |
||
34 | $bound->setScope($this->scope); |
||
35 | $bind->setBound($bound); |
||
36 | $container->add($bind); |
||
37 | } |
||
38 | |||
39 | public function setScope(string $scope): void |
||
42 | } |
||
43 | } |
||
44 |