Total Complexity | 4 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
5 | class SpecItem |
||
6 | { |
||
7 | private string $pattern; |
||
8 | private ?int $tokenType; |
||
9 | |||
10 | /** |
||
11 | * @param string $pattern |
||
12 | * @param ?int $token |
||
13 | */ |
||
14 | 17 | public function __construct(string $pattern, ?int $token) |
|
15 | { |
||
16 | 17 | $this->pattern = $pattern; |
|
17 | 17 | $this->tokenType = $token; |
|
18 | 17 | } |
|
19 | |||
20 | 17 | public static function of(string $pattern, ?int $token): self |
|
21 | { |
||
22 | 17 | return new self($pattern, $token); |
|
23 | } |
||
24 | |||
25 | 17 | public function getPattern(): string |
|
28 | } |
||
29 | |||
30 | 17 | public function getTokenType(): ?int |
|
35 |