LazyErrorHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handleError() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Aidphp\Framework;
6
7
use Aidphp\Error\ErrorHandlerInterface;
8
use Psr\Container\ContainerInterface;
9
use Throwable;
10
use Psr\Http\Message\ServerRequestInterface;
11
use Psr\Http\Message\ResponseInterface;
12
13
class LazyErrorHandler implements ErrorHandlerInterface
14
{
15
    protected $dic;
16
17 3
    public function __construct(ContainerInterface $dic)
18
    {
19 3
        $this->dic = $dic;
20 3
    }
21
22 3
    public function handleError(Throwable $e, ServerRequestInterface $req = null): ResponseInterface
23
    {
24 3
        return $this->dic->get(ErrorHandlerInterface::class)->handleError($e, $req);
25
    }
26
}