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

Token::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 Token
6
{
7
    private ?int $tokenType;
8
    private string $value;
9
10 17
    public function __construct(?int $tokenType, string $value)
11
    {
12 17
        $this->tokenType = $tokenType;
13 17
        $this->value = $value;
14 17
    }
15
16 13
    public function getTokenType(): ?int
17
    {
18 13
        return $this->tokenType;
19
    }
20
21 13
    public function getValue(): string
22
    {
23 13
        return $this->value;
24
    }
25
26 17
    public static function of(?int $tokenType, string $value): static
27
    {
28 17
        return new Token($tokenType, $value);
29
    }
30
}
31