Passed
Pull Request — master (#817)
by Maxim
06:45
created

ContainerException::__construct()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 7
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

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