AddressNotSortableException::getAddress()   A
last analyzed

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 1
Bugs 1 Features 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 1
b 1
f 0
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