ValidateModule::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
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