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

Phrase   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 63
rs 10
ccs 12
cts 12
cp 1
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getFlags() 0 3 1
A getPhrase() 0 3 1
A getQuote() 0 3 1
A getDomain() 0 3 1
A __construct() 0 15 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 Phrase extends Token
9
{
10
11
    /**
12
     * @var string|null
13
     */
14
    private $domain;
15
16
    /**
17
     * @var string
18
     */
19
    private $quote;
20
21
    /**
22
     * @var string
23
     */
24
    private $phrase;
25
26
    /**
27 22
     * @var Flags|null
28
     */
29 22
    private $flags;
30 22
31 22
32
    public function __construct(
33 22
        string $lexeme,
34 22
        int $position,
35
        string $domain,
36
        string $quote,
37 2
        string $phrase,
38
        ?Flags $flags = null
39 2
    )
40
    {
41
        $this->domain = $domain;
42
        $this->quote = $quote;
43 2
        $this->phrase = $phrase;
44
        $this->flags = $flags;
45 2
46
        parent::__construct(Tokenizer::TOKEN_TERM, $lexeme, $position);
47
    }
48
49 2
50
    public function getDomain(): ?string
51 2
    {
52
        return $this->domain;
53
    }
54
55
56
    public function getQuote(): string
57
    {
58
        return $this->quote;
59
    }
60
61
62
    public function getPhrase(): string
63
    {
64
        return $this->phrase;
65
    }
66
67
68
    public function getFlags(): ?Flags
69
    {
70
        return $this->flags;
71
    }
72
73
}
74