Passed
Push — master ( 5162f9...ff69b2 )
by Edward
05:25
created

NonExistingResult::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Remorhaz\JSON\Pointer\Processor\Result;
5
6
use Remorhaz\JSON\Data\Value\NodeValueInterface;
7
8
final class NonExistingResult implements ResultInterface
9
{
10
11
    private $source;
12
13 4
    public function __construct(string $source)
14
    {
15 4
        $this->source = $source;
16 4
    }
17
18 1
    public function exists(): bool
19
    {
20 1
        return false;
21
    }
22
23 1
    public function encode(): string
24
    {
25 1
        throw new Exception\ResultNotFoundException($this->source);
26
    }
27
28 1
    public function decode()
29
    {
30 1
        throw new Exception\ResultNotFoundException($this->source);
31
    }
32
33 1
    public function get(): NodeValueInterface
34
    {
35 1
        throw new Exception\ResultNotFoundException($this->source);
36
    }
37
}
38