Completed
Branch 1.x (cc7bb3)
by Akihito
02:00
created

NamedModule::configure()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.5

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 7
ccs 3
cts 6
cp 0.5
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
crap 2.5
1
<?php
2
/**
3
 * This file is part of the BEAR.Sunday package
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace BEAR\Sunday\Module\Constant;
8
9
use BEAR\Sunday\FakeApplication;
10
use Ray\Di\AbstractModule;
11
12
class NamedModule extends AbstractModule
13
{
14
    /**
15
     * @var array
16
     */
17
    private $names;
18
19
    /**
20
     * @param array $names
21
     */
22 1
    public function __construct(array $names)
23
    {
24 1
        $this->names = $names;
25
        parent::__construct();
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 1
    protected function configure()
32
    {
33
        $this->bind(FakeApplication::class);
34 1
        foreach ($this->names as $annotatedWith => $instance) {
35
            $this->bind()->annotatedWith($annotatedWith)->toInstance($instance);
36
        }
37 1
    }
38
}
39