Passed
Push — main ( 03d0aa...06b87c )
by Stanislav
02:17
created

SpecItem::getTokenType()   A

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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Diezz\YamlToObjectMapper\Resolver\Parser;
4
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
26
    {
27 17
        return $this->pattern;
28
    }
29
30 17
    public function getTokenType(): ?int
31
    {
32 17
        return $this->tokenType;
33
    }
34
}
35