TransactionalModule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 16 1
1
<?php
2
/**
3
 * This file is part of the Ray.DoctrineOrmModule package
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Ray\DoctrineOrmModule;
8
9
use Ray\Di\AbstractModule;
10
use Ray\DoctrineOrmModule\Annotation\Transactional;
11
12
class TransactionalModule extends AbstractModule
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 10
    protected function configure()
18
    {
19
        // Class annotated with @Transactional
20 10
        $this->bindInterceptor(
21 10
            $this->matcher->annotatedWith(Transactional::class),
22 10
            $this->matcher->any(),
23 10
            [TransactionalInterceptor::class]
24 10
        );
25
26
        // Method annotated with @Transactional
27 10
        $this->bindInterceptor(
28 10
            $this->matcher->any(),
29 10
            $this->matcher->annotatedWith(Transactional::class),
30 10
            [TransactionalInterceptor::class]
31 10
        );
32 10
    }
33
}
34