Passed
Pull Request — master (#15)
by Sebastian
04:12
created

hasSpacing()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * File containing the {@see Mailcode_Parser_Statement_Tokenizer_Token_Keyword} class.
4
 *
5
 * @package Mailcode
6
 * @subpackage Parser
7
 * @see Mailcode_Parser_Statement_Tokenizer_Token_Keyword
8
 */
9
10
declare(strict_types=1);
11
12
namespace Mailcode;
13
14
/**
15
 * Token representing a special keyword.
16
 *
17
 * @package Mailcode
18
 * @subpackage Parser
19
 * @author Sebastian Mordziol <[email protected]>
20
 */
21
class Mailcode_Parser_Statement_Tokenizer_Token_Keyword extends Mailcode_Parser_Statement_Tokenizer_Token
22
{
23
    public function getNormalized(): string
24
    {
25
        return $this->getMatchedText();
26
    }
27
28
    public function hasSpacing(): bool
29
    {
30
        return true;
31
    }
32
33
    /**
34
     * Retrieves the keyword, with : appended.
35
     *
36
     * @return string
37
     */
38
    public function getKeyword() : string
39
    {
40
        return $this->getMatchedText();
41
    }
42
    
43
    public function isForIn() : bool
44
    {
45
        return $this->getKeyword() === Mailcode_Commands_Keywords::TYPE_IN;
46
    }
47
    
48
    public function isInsensitive() : bool
49
    {
50
        return $this->getKeyword() === Mailcode_Commands_Keywords::TYPE_INSENSITIVE;
51
    }
52
53
    public function isURLEncoded() : bool
54
    {
55
        return $this->getKeyword() === Mailcode_Commands_Keywords::TYPE_URLENCODE;
56
    }
57
58
    public function isURLDecode() : bool
59
    {
60
        return $this->getKeyword() === Mailcode_Commands_Keywords::TYPE_URLDECODE;
61
    }
62
63
    public function isNoHTML() : bool
64
    {
65
        return $this->getKeyword() === Mailcode_Commands_Keywords::TYPE_NOHTML;
66
    }
67
}
68