| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class ErrorHandler implements ErrorHandlerInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var ErrorMiddlewareInterface[] |
||
| 12 | */ |
||
| 13 | protected $middleware; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * ErrorHandler constructor. |
||
| 17 | * @param ErrorMiddlewareInterface[] $middleware |
||
| 18 | */ |
||
| 19 | public function __construct(array $middleware) |
||
| 20 | { |
||
| 21 | foreach ($middleware as $mw) { |
||
| 22 | $this->addMiddleware($mw); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @inheritdoc |
||
| 28 | */ |
||
| 29 | public function handle(ExecutionException $exception, ExecutionContext $context): void |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param ErrorMiddlewareInterface $middleware |
||
| 47 | */ |
||
| 48 | protected function addMiddleware(ErrorMiddlewareInterface $middleware): void |
||
| 51 | } |
||
| 52 | } |
||
| 53 |