Passed
Push — master ( 44c68b...bebfba )
by Tomáš
10:58
created

Word   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 44
rs 10
ccs 9
cts 9
cp 1
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDomain() 0 3 1
A getFlags() 0 3 1
A getWord() 0 3 1
A __construct() 0 7 1
1
<?php declare(strict_types = 1);
2
3
namespace Apicart\FQL\Token\Token;
4
5
use Apicart\FQL\Tokenizer\Tokenizer;
6
use Apicart\FQL\Value\Token;
7
8
final class Word extends Token
9
{
10
11
    /**
12
     * @var string
13
     */
14
    private $domain;
15
16
    /**
17
     * @var string
18
     */
19
    private $word;
20
21
    /**
22 376
     * @var Flags|null
23
     */
24 376
    private $flags;
25 376
26
27 376
    public function __construct(string $lexeme, int $position, string $domain, string $word, ?Flags $flags = null)
28 376
    {
29
        $this->domain = $domain;
30
        $this->word = $word;
31 134
        $this->flags = $flags;
32
33 134
        parent::__construct(Tokenizer::TOKEN_TERM, $lexeme, $position);
34
    }
35
36
37 134
    public function getDomain(): string
38
    {
39 134
        return $this->domain;
40
    }
41
42
43
    public function getWord(): string
44
    {
45
        return $this->word;
46
    }
47
48
49
    public function getFlags(): ?Flags
50
    {
51
        return $this->flags;
52
    }
53
54
}
55