GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — master ( c5ade0...e039e4 )
by Gabriel
05:51
created

DebugbarMiddleware::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Nip\DebugBar\Middleware;
4
5
use Interop\Http\ServerMiddleware\DelegateInterface;
6
use Nip\DebugBar\DebugBar;
7
use Nip\Http\ServerMiddleware\Middlewares\ServerMiddlewareInterface;
8
use Psr\Http\Message\ServerRequestInterface;
9
10
/**
11
 * Class DebugbarMiddleware
12
 * @package Nip\DebugBar\Middleware
13
 */
14
class DebugbarMiddleware implements ServerMiddlewareInterface
15
{
16
    /**
17
     * The DebugBar instance
18
     *
19
     * @var DebugBar
20
     */
21
    protected $debugbar;
22
23
    /**
24
     * Create a new session middleware.
25
     *
26
     * @param  DebugBar $debugbar
27
     */
28
    public function __construct(DebugBar $debugbar)
29
    {
30
        $this->debugbar = $debugbar;
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    public function process(ServerRequestInterface $request, DelegateInterface $delegate)
37
    {
38
        $response = $delegate->process($request);
39
40
        // Modify the response to add the Debugbar
41
        $this->debugbar->modifyResponse($request, $response);
0 ignored issues
show
Compatibility introduced by
$request of type object<Psr\Http\Message\ServerRequestInterface> is not a sub-type of object<Nip\Request>. It seems like you assume a concrete implementation of the interface Psr\Http\Message\ServerRequestInterface to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
Compatibility introduced by
$response of type object<Psr\Http\Message\ResponseInterface> is not a sub-type of object<Nip\Http\Response\Response>. It seems like you assume a concrete implementation of the interface Psr\Http\Message\ResponseInterface to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
42
        return $response;
43
    }
44
}