AssistedModule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
c 0
b 0
f 0
dl 0
loc 7
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\Di;
6
7
use Ray\Aop\MethodInvocation;
8
9
/**
10
 * Module for assisted injection using PHP 8 attributes
11
 *
12
 * This module enables assisted injection by delegating to AssistedInjectModule
13
 * and provides necessary bindings for method invocation context.
14
 * Use #[Assisted] attribute on method parameters to enable automatic injection.
15
 */
16
final class AssistedModule extends AbstractModule
17
{
18
    protected function configure(): void
19
    {
20
        $this->install(new AssistedInjectModule());
21
        $this->bind(MethodInvocation::class)->toProvider(MethodInvocationProvider::class)->in(Scope::SINGLETON);
22
        $this->bind(MethodInvocationProvider::class)->in(Scope::SINGLETON);
23
    }
24
}
25