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

EnumLocatorInjector::createInjection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 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<EnumLocator>
14
 */
15
final class EnumLocatorInjector 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
    ): EnumsInterface {
29 1
        return $this->tokenizer->enumLocator();
30
    }
31
}
32