AddressNotSortableException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAddress() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Remorhaz\JSON\Path\Runtime\Matcher\Exception;
6
7
use DomainException;
8
use Throwable;
9
10
final class AddressNotSortableException extends DomainException implements ExceptionInterface
11
{
12
13
    private $address;
14
15
    /**
16
     * @param int|string     $address
17
     * @param Throwable|null $previous
18
     */
19 6
    public function __construct($address, Throwable $previous = null)
20
    {
21 6
        $this->address = $address;
22 6
        parent::__construct("Index/property is not sortable: {$this->address}", 0, $previous);
23 6
    }
24
25
    /**
26
     * @return int|string
27
     */
28 2
    public function getAddress()
29
    {
30 2
        return $this->address;
31
    }
32
}
33