AuraInputModule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 28
ccs 19
cts 19
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 22 1
1
<?php
2
/**
3
 * This file is part of the Ray.WebFormModule package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Ray\WebFormModule;
8
9
use Aura\Filter\FilterFactory;
10
use Aura\Html\HelperLocatorFactory;
11
use Aura\Input\AntiCsrfInterface;
12
use Aura\Input\Builder;
13
use Aura\Input\BuilderInterface;
14
use Aura\Input\Filter;
15
use Aura\Input\FilterInterface;
16
use Doctrine\Common\Annotations\AnnotationReader;
17
use Doctrine\Common\Annotations\Reader;
18
use Ray\AuraSessionModule\AuraSessionModule;
19
use Ray\Di\AbstractModule;
20
use Ray\Di\Scope;
21
use Ray\WebFormModule\Annotation\FormValidation;
22
use Ray\WebFormModule\Annotation\InputValidation;
23
24
class AuraInputModule extends AbstractModule
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29 12
    protected function configure()
30
    {
31 12
        $this->install(new AuraSessionModule);
0 ignored issues
show
Documentation introduced by
new \Ray\AuraSessionModule\AuraSessionModule() is of type object<Ray\AuraSessionModule\AuraSessionModule>, but the function expects a object<self>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
32 12
        $this->bind(Reader::class)->to(AnnotationReader::class)->in(Scope::SINGLETON);
33 12
        $this->bind(BuilderInterface::class)->to(Builder::class);
34 12
        $this->bind(FilterInterface::class)->to(Filter::class);
35 12
        $this->bind(AntiCsrfInterface::class)->to(AntiCsrf::class)->in(Scope::SINGLETON);
36 12
        $this->bind(FailureHandlerInterface::class)->to(OnFailureMethodHandler::class);
37 12
        $this->bind(FailureHandlerInterface::class)->annotatedWith('vnd_error')->to(VndErrorHandler::class)->in(Scope::SINGLETON);
38 12
        $this->bind(HelperLocatorFactory::class);
39 12
        $this->bind(FilterFactory::class);
40 12
        $this->bindInterceptor(
41 12
            $this->matcher->any(),
42 12
            $this->matcher->annotatedWith(InputValidation::class),
43 12
            [InputValidationInterceptor::class]
44
        );
45 12
        $this->bindInterceptor(
46 12
            $this->matcher->any(),
47 12
            $this->matcher->annotatedWith(FormValidation::class),
48 12
            [AuraInputInterceptor::class]
49
        );
50 12
    }
51
}
52