TokenNotMatchedException::getOffsets()   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 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Remorhaz\Lexer\Runtime\Token\Exception;
6
7
use RuntimeException;
8
use Throwable;
9
10
final class TokenNotMatchedException extends RuntimeException 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("Token not matched", 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