ValidateModule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 9 1
1
<?php
2
/**
3
 * This file is part of the Ray.ValidateModule package
4
 *
5
 * @license http://opensource.org/licenses/bsd-license.php BSD
6
 */
7
namespace Ray\Validation;
8
9
use Doctrine\Common\Annotations\AnnotationReader;
10
use Doctrine\Common\Annotations\Reader;
11
use Ray\Di\AbstractModule;
12
use Ray\Di\Scope;
13
use Ray\Validation\Annotation\Valid;
14
15
class ValidateModule extends AbstractModule
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    protected function configure()
21
    {
22
        $this->bind(Reader::class)->to(AnnotationReader::class)->in(Scope::SINGLETON);
23
        $this->bindInterceptor(
24
            $this->matcher->any(),
25
            $this->matcher->annotatedWith(Valid::class),
26
            [ValidateInterceptor::class]
27
        );
28
    }
29
}
30