Total Complexity | 5 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 92.31% |
Changes | 0 |
1 | <?php |
||
10 | class CatchMiddleware extends AbstractWrapperMiddleware |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $catchClass; |
||
16 | /** |
||
17 | * @var callable |
||
18 | */ |
||
19 | protected $catcher; |
||
20 | |||
21 | 1 | public function __construct($innerMiddleware, callable $catcher, string $catchClass = \Throwable::class) |
|
22 | { |
||
23 | 1 | parent::__construct($innerMiddleware); |
|
24 | 1 | $this->catchClass = $catchClass; |
|
25 | 1 | $this->catcher = $catcher; |
|
26 | 1 | } |
|
27 | |||
28 | 1 | public static function catcher(callable $catcher, string $catchClass = \Throwable::class): MiddlewareInterface |
|
31 | } |
||
32 | |||
33 | 1 | protected function main(): ResponseInterface |
|
42 | } |
||
43 | } |
||
45 |