InvalidRangeException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 0
f 0
dl 0
loc 28
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getStart() 0 3 1
A getFinish() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Remorhaz\IntRangeSets\Exception;
6
7
use LogicException;
8
use Throwable;
9
10
final class InvalidRangeException extends LogicException implements ExceptionInterface
11
{
12
13
    /**
14
     * @var int
15
     */
16
    private $start;
17
18
    /**
19
     * @var int
20
     */
21
    private $finish;
22
23 6
    public function __construct(int $start, int $finish, Throwable $previous = null)
24
    {
25 6
        $this->start = $start;
26 6
        $this->finish = $finish;
27 6
        parent::__construct("Invalid range: [{$this->start}, {$this->finish}]", 0, $previous);
28 6
    }
29
30 1
    public function getStart(): int
31
    {
32 1
        return $this->start;
33
    }
34
35 1
    public function getFinish(): int
36
    {
37 1
        return $this->finish;
38
    }
39
}
40