Completed
Push — dev-master ( 710732...009af4 )
by Karol
03:53 queued 10s
created

decodeControllerParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 9
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Pgs\HashIdBundle\Service\Sf34;
6
7
use Pgs\HashIdBundle\Service\AbstractDecodeControllerParameters;
8
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
9
10
class DecodeControllerParameters extends AbstractDecodeControllerParameters
11
{
12
    public function decodeControllerParameters(FilterControllerEvent $event): void
13
    {
14
        $controller = $event->getController();
15
        $parametersProcessor = $this
0 ignored issues
show
Bug introduced by
The call to Pgs\HashIdBundle\Paramet...deParametersProcessor() has too few arguments starting with method. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
            ->/** @scrutinizer ignore-call */ createControllerDecodeParametersProcessor(...$controller);

This check compares calls to functions or methods with their respective definitions. If the call has less 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. Please note the @ignore annotation hint above.

Loading history...
16
            ->getParametersProcessorFactory()
17
            ->createControllerDecodeParametersProcessor(...$controller);
18
19
        $this->processRequestParameters($event, $parametersProcessor);
20
        $this->processRequestParametersWithParamConverter($event);
21
    }
22
}
23