Completed
Pull Request — 1.x (#9)
by Akihito
04:16 queued 03:14
created

AppMetaModule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

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

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
    public function __construct(AbstractAppMeta $appMeta)
21
    {
22
        $this->appMeta = $appMeta;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    protected function configure()
29
    {
30
        $this->bind(AbstractAppMeta::class)->toInstance($this->appMeta);
31
        $this->bind('')->annotatedWith(AppName::class)->toInstance($this->appMeta->name);
32
    }
33
}
34