Completed
Push — json-schema ( de2f1b )
by Akihito
04:23 queued 10s
created

CamelCaseKeyModule   A

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
declare(strict_types=1);
4
5
namespace BEAR\Resource\Module;
6
7
use BEAR\Resource\Interceptor\CamelCaseKeyInterceptor;
8
use BEAR\Resource\ResourceObject;
9
use Doctrine\Common\Annotations\AnnotationReader;
10
use Doctrine\Common\Annotations\Reader;
11
use Ray\Di\AbstractModule;
12
13
class CamelCaseKeyModule extends AbstractModule
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    protected function configure()
19
    {
20
        $this->bind(Reader::class)->to(AnnotationReader::class);
21
        $this->bindInterceptor(
22
            $this->matcher->subclassesOf(ResourceObject::class),
23
            $this->matcher->startsWith('toString'),
24
            [CamelCaseKeyInterceptor::class]
25
        );
26
    }
27
}
28