PointerReferenceNotFoundException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php declare(strict_types=1);
2
3
namespace DaveRandom\Jom\Exceptions;
4
5
use DaveRandom\Jom\Pointer;
6
7
final class PointerReferenceNotFoundException extends Exception
8
{
9 15
    public function __construct(string $message, Pointer $pointer, ?int $level = null, ?\Throwable $previous = null)
10
    {
11 15
        $message = \sprintf("%s while evaluating pointer '%s'", $message, (string)$pointer);
12
13 15
        if ($level !== null) {
14 3
            $message .= \sprintf(" at component '%s' (path component index %d)", $pointer->getPath()[$level], $level);
15
        }
16
17 15
        parent::__construct($message, 0, $previous);
18
    }
19
}
20