Completed
Push — fetcher_factories ( 10a56f...fd93ea )
by David
13:44
created

TestFilter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 21
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 6 1
1
<?php
2
3
4
namespace Mouf\Mvc\Splash\Fixtures;
5
6
use Interop\Container\ContainerInterface;
7
use Psr\Http\Message\ResponseInterface;
8
use Psr\Http\Message\ServerRequestInterface;
9
10
/**
11
 * @Annotation
12
 */
13
class TestFilter
14
{
15
    private $params;
16
17
    /**
18
     * TestFilter constructor.
19
     * @param $params
20
     */
21
    public function __construct($params)
22
    {
23
        $this->params = $params;
24
    }
25
26
27
    public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next, ContainerInterface $container)
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {
29
        $request = $request->withQueryParams(array_merge($request->getQueryParams(), $this->params));
30
        $response = $next($request, $response);
31
        return $response;
32
    }
33
}