SessionalModule::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
ccs 12
cts 12
cp 1
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Ray\SymfonySessionModule;
4
5
use Ray\Di\AbstractModule;
6
use Ray\SymfonySessionModule\Annotation\Sessional;
7
8
class SessionalModule extends AbstractModule
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 5
    protected function configure()
14
    {
15
        // Class annotated with @Sessional
16 5
        $this->bindInterceptor(
17 5
            $this->matcher->annotatedWith(Sessional::class),
18 5
            $this->matcher->any(),
19 5
            [SessionalInterceptor::class]
20 5
        );
21
22
        // Method annotated with @Sessional
23 5
        $this->bindInterceptor(
24 5
            $this->matcher->any(),
25 5
            $this->matcher->annotatedWith(Sessional::class),
26 5
            [SessionalInterceptor::class]
27 5
        );
28 5
    }
29
}
30