Failed Conditions
Push — experimental/3.1 ( c6bbe9...5ca513 )
by Yangsin
235:43 queued 228:52
created

DIServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 20 2
A boot() 0 4 1
1
<?php
2
3
namespace Eccube\DI;
4
5
use Doctrine\Common\Annotations\AnnotationReader;
6
use Pimple\Container;
7
use Pimple\ServiceProviderInterface;
8
use Silex\Api\BootableProviderInterface;
9
use Silex\Application;
10
11
class DIServiceProvider implements ServiceProviderInterface, BootableProviderInterface
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
12
{
13
    public function register(Container $app)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
14
    {
15 1111
        $app['eccube.di'] = function (Container $app) {
16 1111
            $di = new DependencyBuilder(
17 1111
                $app['eccube.di.generator.dir'],
18 1111
                $app['eccube.di.generator.class'],
19 1111
                $app['eccube.di.wirings'],
20 1111
                $app['eccube.di.annotation_reader'],
21 1111
                $app['eccube.di.debug']
22
            );
23
24 1111
            return $di;
25
        };
26
27 1111
        $app['eccube.di.debug'] = $app['debug'];
28 1111
        $app['eccube.di.annotation_reader'] = isset($app['annotations']) ? $app['annotations'] : new AnnotationReader();
29
30 1111
        $app['eccube.di.generator.dir'] = null;
31 1111
        $app['eccube.di.generator.class'] = 'ServiceProviderCache';
32
    }
33
34 1111
    public function boot(Application $app)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
35
    {
36 1111
        $app['eccube.di']->build($app);
37
    }
38
}
39