Passed
Push — master ( 813f0f...a309d2 )
by butschster
09:30 queued 12s
created

InterfaceLocatorInjector   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A createInjection() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Tokenizer;
6
7
use Spiral\Core\Container\InjectorInterface;
8
use Spiral\Core\Exception\Container\InjectionException;
9
10
/**
11
 * Manages automatic container injections of class and invocation locators.
12
 *
13
 * @implements InjectorInterface<InterfaceLocator>
14
 */
15
final class InterfaceLocatorInjector implements InjectorInterface
16
{
17 1
    public function __construct(
18
        private readonly Tokenizer $tokenizer
19
    ) {
20 1
    }
21
22
    /**
23
     * @throws InjectionException
24
     */
25 1
    public function createInjection(
26
        \ReflectionClass $class,
27
        string $context = null
28
    ): InterfacesInterface {
29 1
        return $this->tokenizer->interfaceLocator();
30
    }
31
}
32