WebContextParamModule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 1
c 4
b 0
f 0
lcom 1
cbo 3
dl 0
loc 23
ccs 16
cts 16
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 17 1
1
<?php
2
/**
3
 * This file is part of the Ray.AuraSqlModule package
4
 *
5
 * @license http://opensource.org/licenses/bsd-license.php MIT
6
 */
7
namespace Ray\WebContextParam;
8
9
use Doctrine\Common\Annotations\AnnotationReader;
10
use Doctrine\Common\Annotations\Reader;
11
use Doctrine\Common\Cache\ArrayCache;
12
use Doctrine\Common\Cache\Cache;
13
use Ray\Di\AbstractModule;
14
use Ray\Di\Scope;
15
use Ray\WebContextParam\Annotation\CookieParam;
16
use Ray\WebContextParam\Annotation\EnvParam;
17
use Ray\WebContextParam\Annotation\FormParam;
18
use Ray\WebContextParam\Annotation\QueryParam;
19
use Ray\WebContextParam\Annotation\ServerParam;
20
21
class WebContextParamModule extends AbstractModule
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26 1
    protected function configure()
27
    {
28 1
        $this->bindInterceptor(
29 1
            $this->matcher->any(),
30 1
            $this->matcher->logicalOr(
31 1
                $this->matcher->annotatedWith(QueryParam::class),
32 1
                $this->matcher->annotatedWith(CookieParam::class),
33 1
                $this->matcher->annotatedWith(FormParam::class),
0 ignored issues
show
Unused Code introduced by
The call to Matcher::logicalOr() has too many arguments starting with $this->matcher->annotate...ation\FormParam::class).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
34 1
                $this->matcher->annotatedWith(EnvParam::class),
35 1
                $this->matcher->annotatedWith(ServerParam::class)
36 1
            ),
37 1
            [WebContextParamInterceptor::class]
38 1
        );
39 1
        $this->bind(Reader::class)->to(AnnotationReader::class)->in(Scope::SINGLETON);
40 1
        $this->bind(Cache::class)->to(ArrayCache::class)->in(Scope::SINGLETON);
41 1
        $this->bind(WebContext::class);
42 1
    }
43
}
44