UnexpectedEndOfInputException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getOffsets() 0 3 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