Completed
Pull Request — 1.x (#9)
by Akihito
01:32
created

AppMetaModule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 21
c 0
b 0
f 0
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A configure() 0 5 1
1
<?php
2
/**
3
 * This file is part of the BEAR.Middleware package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace BEAR\Middleware\Module;
8
9
use BEAR\AppMeta\AbstractAppMeta;
10
use BEAR\Resource\Annotation\AppName;
11
use Ray\Di\AbstractModule;
12
13
class AppMetaModule extends AbstractModule
14
{
15
    /**
16
     * @var AbstractAppMeta
17
     */
18
    private $appMeta;
19
20 2
    public function __construct(AbstractAppMeta $appMeta)
21
    {
22 2
        $this->appMeta = $appMeta;
23 2
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 2
    protected function configure()
29
    {
30 2
        $this->bind(AbstractAppMeta::class)->toInstance($this->appMeta);
31 2
        $this->bind('')->annotatedWith(AppName::class)->toInstance($this->appMeta->name);
32 2
    }
33
}
34