Passed
Pull Request — master (#817)
by Maxim
10:47 queued 04:55
created

ContainerException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 11
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Core\Exception\Container;
6
7
use Psr\Container\ContainerExceptionInterface;
8
use Spiral\Core\Exception\RuntimeException;
9
use Spiral\Core\Internal\Tracer;
10
11
/**
12
 * Something inside container.
13
 */
14
class ContainerException extends RuntimeException implements ContainerExceptionInterface
15
{
16 453
    public function __construct(
17
        string $message = '',
18
        int $code = 0,
19
        ?\Throwable $previous = null,
20
        protected ?Tracer $tracer = null
21
    ) {
22 453
        parent::__construct($tracer !== null ? $message . PHP_EOL . $tracer : $message, $code, $previous);
23
24 453
        $tracer?->clean();
25
    }
26
}
27