ReplaceAtNestedPathsException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getParentPath() 0 3 1
A getNestedPath() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Remorhaz\JSON\Path\Processor\Mutator\Exception;
6
7
use LogicException;
8
use Remorhaz\JSON\Data\Path\PathInterface;
9
use Throwable;
10
11
final class ReplaceAtNestedPathsException extends LogicException implements ExceptionInterface
12
{
13
14
    private $parentPath;
15
16
    private $nestedPath;
17
18 6
    public function __construct(PathInterface $parentPath, PathInterface $nestedPath, Throwable $previous = null)
19
    {
20 6
        $this->parentPath = $parentPath;
21 6
        $this->nestedPath = $nestedPath;
22 6
        parent::__construct("Attempt of replacing value at nested paths", 0, $previous);
23 6
    }
24
25 1
    public function getParentPath(): PathInterface
26
    {
27 1
        return $this->parentPath;
28
    }
29
30 1
    public function getNestedPath(): PathInterface
31
    {
32 1
        return $this->nestedPath;
33
    }
34
}
35