Completed
Push — master ( 08f0e0...238323 )
by Changwan
03:09
created

AnnotationServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
A boot() 0 3 1
1
<?php
2
namespace Wandu\DI\Providers\Doctrine;
3
4
use Doctrine\Common\Annotations\AnnotationReader;
5
use Doctrine\Common\Annotations\CachedReader;
6
use Doctrine\Common\Annotations\Reader;
7
use Doctrine\Common\Cache\Cache;
8
use Wandu\Config\Contracts\Config;
9
use Wandu\DI\ContainerInterface;
10
use Wandu\DI\ServiceProviderInterface;
11
12
class AnnotationServiceProvider implements ServiceProviderInterface 
13
{
14
    public function register(ContainerInterface $app)
15
    {
16
        $app->closure(Reader::class, function (Cache $cache, Config $config) {
17
            return new CachedReader(new AnnotationReader(), $cache, $config->get('debug', true));
18
        });
19
    }
20
21
    public function boot(ContainerInterface $app)
22
    {
23
    }
24
}
25