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

NonExistingResult   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 28
ccs 11
cts 11
cp 1
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A encode() 0 3 1
A decode() 0 3 1
A exists() 0 3 1
A __construct() 0 3 1
A get() 0 3 1
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