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.
Completed
Push — master ( 30b5dd...e3dde5 )
by Hong
02:42
created

Phossa2RouteMiddleware::before()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 2
1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Middleware
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Middleware\Middleware;
16
17
use Phossa2\Route\Dispatcher;
18
use Psr\Http\Message\RequestInterface;
19
use Psr\Http\Message\ResponseInterface;
20
21
/**
22
 * Phossa2RouteMiddleware
23
 *
24
 * Using phossa2/route to dispatching
25
 *
26
 * @package Phossa2\Middleware
27
 * @author  Hong Zhang <[email protected]>
28
 * @see     MiddlewareAbstract
29
 * @version 2.0.0
30
 * @since   2.0.0 added
31
 */
32
class Phossa2RouteMiddleware extends MiddlewareAbstract
33
{
34
    /**
35
     * @var    Dispatcher
36
     * @access protected
37
     */
38
    protected $dispatcher;
39
40
    /**
41
     * @param  Dispatcher $dispatcher
42
     * @access public
43
     */
44
    public function __construct(Dispatcher $dispatcher)
45
    {
46
        $this->dispatcher = $dispatcher;
47
    }
48
49
    /**
50
     * {@inheritDoc}
51
     */
52
    protected function before(
53
        RequestInterface $request,
54
        ResponseInterface $response
55
    )/* : ResponseInterface */ {
56
        $this->dispatcher->dispatch(
57
            $request->getMethod(),
58
            $request->getUri()->getPath(),
59
            ['request' => $request, 'response' => $response]
60
        );
61
62
        // response in the result
63
        return $this->dispatcher->getResult()->getParameters()['response'];
64
    }
65
66
    /**
67
     * Doing nothing afterwards
68
     *
69
     * {@inheritDoc}
70
     */
71
    protected function after(
72
        RequestInterface $request,
73
        ResponseInterface $response
74
    )/* : ResponseInterface */ {
75
        return $response;
76
    }
77
}
78