Passed
Push — master ( 6e90f8...abd917 )
by Sebastian
04:44
created

Mailcode_Parser_Statement_Tokenizer_Token_Keyword   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 8
c 3
b 0
f 0
dl 0
loc 40
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getNormalized() 0 3 1
A isInsensitive() 0 3 1
A isURLEncoded() 0 3 1
A isForIn() 0 3 1
A isURLDecode() 0 3 1
A getKeyword() 0 3 1
A isNoHTML() 0 3 1
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
    /**
29
     * Retrieves the keyword, with : appended.
30
     *
31
     * @return string
32
     */
33
    public function getKeyword() : string
34
    {
35
        return $this->getMatchedText();
36
    }
37
    
38
    public function isForIn() : bool
39
    {
40
        return $this->getKeyword() === Mailcode_Commands_Keywords::TYPE_IN;
41
    }
42
    
43
    public function isInsensitive() : bool
44
    {
45
        return $this->getKeyword() === Mailcode_Commands_Keywords::TYPE_INSENSITIVE;
46
    }
47
48
    public function isURLEncoded() : bool
49
    {
50
        return $this->getKeyword() === Mailcode_Commands_Keywords::TYPE_URLENCODE;
51
    }
52
53
    public function isURLDecode() : bool
54
    {
55
        return $this->getKeyword() === Mailcode_Commands_Keywords::TYPE_URLDECODE;
56
    }
57
58
    public function isNoHTML() : bool
59
    {
60
        return $this->getKeyword() === Mailcode_Commands_Keywords::TYPE_NOHTML;
61
    }
62
}
63