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

AnnotationServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
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