NamedModule::configure()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 2
b 0
f 0
nc 2
nop 0
dl 0
loc 4
rs 10
ccs 3
cts 3
cp 1
crap 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