Test Failed
Pull Request — master (#947)
by
unknown
09:21 queued 01:29
created

InterfaceLocatorInjector   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 15
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
    public function __construct(
18
        private readonly Tokenizer $tokenizer
19
    ) {
20
    }
21
22
    /**
23
     * @throws InjectionException
24
     */
25
    public function createInjection(
26
        \ReflectionClass $class,
27
        string $context = null
28
    ): InterfacesInterface {
29
        return $this->tokenizer->interfaceLocator();
30
    }
31
}
32