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

SpecItem   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 28
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

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