NamedModule   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 4
c 4
b 0
f 0
dl 0
loc 13
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 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Sunday\Module\Constant;
6
7
use Ray\Di\AbstractModule;
8
9
class NamedModule extends AbstractModule
10
{
11
    /** @param array<string, string> $names */
12
    public function __construct(
13
        private array $names,
14
    ) {
15
        parent::__construct();
16 1
    }
17
18 1
    protected function configure(): void
19 1
    {
20 1
        foreach ($this->names as $annotatedWith => $instance) {
21
            $this->bind()->annotatedWith($annotatedWith)->toInstance($instance);
22
        }
23
    }
24
}
25