NamedModule   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A configure() 0 5 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Sunday\Module\Constant;
6
7
use Override;
8
use Ray\Di\AbstractModule;
9
10
final class NamedModule extends AbstractModule
11
{
12
    /** @param array<string, string> $names */
13
    public function __construct(
14
        private array $names,
15
    ) {
16 1
        parent::__construct();
17
    }
18 1
19 1
    #[Override]
20 1
    protected function configure(): void
21
    {
22
        foreach ($this->names as $annotatedWith => $instance) {
23
            $this->bind()->annotatedWith($annotatedWith)->toInstance($instance);
24
        }
25 1
    }
26
}
27