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

Word::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 5
dl 0
loc 7
rs 10
ccs 4
cts 4
cp 1
crap 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