LazyErrorHandler::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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
}