Passed
Push — master ( 91b62f...022aa2 )
by Henri
01:21
created

Lasted::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
nc 2
nop 2
dl 0
loc 7
c 0
b 0
f 0
cc 2
rs 10
1
<?php
2
3
namespace Example\Middleware;
4
5
use Exception;
6
use Psr\Http\Message\ServerRequestInterface;
7
use Psr\Http\Message\ResponseInterface;
8
use Psr\Http\Server\RequestHandlerInterface;
9
10
class Lasted extends Middleware{
11
12
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
13
    {
14
        if(!isset($this->error)){
0 ignored issues
show
Bug Best Practice introduced by
The property error does not exist on Example\Middleware\Lasted. Since you implemented __get, consider adding a @property annotation.
Loading history...
15
            throw new Exception("Access not belonged: {$this->error}");
16
        }
17
18
        return parent::process($request, $handler);
19
    }
20
21
}