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

Lasted   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 9
c 0
b 0
f 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 7 2
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
}