UnexpectedEndOfInputException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Remorhaz\Lexer\Runtime\Token\Exception;
6
7
use LogicException;
8
use Throwable;
9
10
final class UnexpectedEndOfInputException extends LogicException implements ExceptionInterface
11
{
12
13
    /**
14
     * @var int[]
15
     * @psalm-var array<int,int>
16
     */
17
    private $offsets;
18
19
    /**
20
     * @param int[]          $offsets
21
     * @psalm-param array<int,int> $offsets
22
     * @param Throwable|null $previous
23
     */
24 5
    public function __construct(array $offsets, Throwable $previous = null)
25
    {
26 5
        $this->offsets = $offsets;
27 5
        parent::__construct("Unexpected end of input", 0, $previous);
28 5
    }
29
30
    /**
31
     * @return int[]
32
     * @psalm-return array<int,int>
33
     * @psalm-pure
34
     */
35 1
    public function getOffsets(): array
36
    {
37 1
        return $this->offsets;
38
    }
39
}
40