Completed
Push — 1.x ( ed7876...cc7bb3 )
by Akihito
03:45 queued 01:48
created

DoctrineAnnotationModule   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 40%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 12
ccs 2
cts 5
cp 0.4
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 6 1
1
<?php
2
/**
3
 * This file is part of the BEAR.Sunday package
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace BEAR\Sunday\Module\Annotation;
8
9
use Doctrine\Common\Annotations\AnnotationReader;
10
use Doctrine\Common\Annotations\CachedReader;
11
use Doctrine\Common\Annotations\Reader;
12
use Doctrine\Common\Cache\ArrayCache;
13
use Doctrine\Common\Cache\Cache;
14
use Ray\Di\AbstractModule;
15
use Ray\Di\Scope;
16
17
class DoctrineAnnotationModule extends AbstractModule
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22 4
    protected function configure()
23
    {
24
        $this->bind(Cache::class)->annotatedWith('annotation_cache')->to(ArrayCache::class)->in(Scope::SINGLETON);
25
        $this->bind(Reader::class)->annotatedWith('annotation_reader')->to(AnnotationReader::class)->in(Scope::SINGLETON);
26
        $this->bind(Reader::class)->toConstructor(CachedReader::class, 'reader=annotation_reader,cache=annotation_cache')->in(Scope::SINGLETON);
27 4
    }
28
}
29