Passed
Push — master ( 3a32e2...77143f )
by Edward
04:21
created

NonExistingResult   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 23
ccs 9
cts 9
cp 1
rs 10
wmc 4

4 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
1
<?php
2
declare(strict_types=1);
3
4
namespace Remorhaz\JSON\Pointer\Processor\Result;
5
6
final class NonExistingResult implements ResultInterface
7
{
8
9
    private $source;
10
11 3
    public function __construct(string $source)
12
    {
13 3
        $this->source = $source;
14 3
    }
15
16 1
    public function exists(): bool
17
    {
18 1
        return false;
19
    }
20
21 1
    public function encode(): string
22
    {
23 1
        throw new Exception\ResultNotFoundException($this->source);
24
    }
25
26 1
    public function decode()
27
    {
28 1
        throw new Exception\ResultNotFoundException($this->source);
29
    }
30
}
31