Passed
Push — master ( 77143f...a64a81 )
by Edward
03:21
created

ParentNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSource() 0 3 1
A __construct() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Remorhaz\JSON\Pointer\Query\Exception;
5
6
use LogicException;
7
use Throwable;
8
9
final class ParentNotFoundException extends LogicException implements ExceptionInterface
10
{
11
12
    private $source;
13
14 5
    public function __construct(string $source, Throwable $previous = null)
15
    {
16 5
        $this->source = $source;
17 5
        parent::__construct("Query '{$this->source}' selected no parent node", 0, $previous);
18 5
    }
19
20 1
    public function getSource(): string
21
    {
22 1
        return $this->source;
23
    }
24
}
25