Completed
Pull Request — 1.x (#214)
by Yuu
03:24 queued 55s
created

AppMetaModule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 50%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 1
cbo 3
dl 0
loc 22
ccs 4
cts 8
cp 0.5
rs 10

2 Methods

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