Passed
Push — master ( 77f2a3...0c35c3 )
by Sebastian
03:02
created

Mailcode_Commands_IfBase::isNotContains()   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
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * File containing the {@see Mailcode_Commands_IfBase} class.
4
 *
5
 * @package Mailcode
6
 * @subpackage Commands
7
 * @see Mailcode_Commands_IfBase
8
 */
9
10
declare(strict_types=1);
11
12
namespace Mailcode;
13
14
/**
15
 * Abstract base class for IF commands (IF, ELSEIF).
16
 *
17
 * @package Mailcode
18
 * @subpackage Commands
19
 * @author Sebastian Mordziol <[email protected]>
20
 */
21
abstract class Mailcode_Commands_IfBase extends Mailcode_Commands_Command
22
{
23
    public function supportsType(): bool
24
    {
25
        return true;
26
    }
27
28
    public function supportsURLEncoding() : bool
29
    {
30
        return false;
31
    }
32
    
33
    public function requiresParameters(): bool
34
    {
35
        return true;
36
    }
37
    
38
    public function supportsLogicKeywords() : bool
39
    {
40
        return true;
41
    }
42
    
43
    public function isCommand() : bool
44
    {
45
        return $this->type === 'command' || empty($this->type);
46
    }
47
    
48
    public function isVariable() : bool
49
    {
50
        return $this->type === 'variable';
51
    }
52
    
53
    public function isContains() : bool
54
    {
55
        return $this->type === 'contains';
56
    }
57
58
    public function isNotContains() : bool
59
    {
60
        return $this->type === 'not-contains';
61
    }
62
    
63
    protected function getValidations() : array
64
    {
65
        return array();
66
    }
67
    
68
    public function generatesContent() : bool
69
    {
70
        return false;
71
    }
72
    
73
    public function getSupportedTypes() : array
74
    {
75
        return array(
76
            'variable',
77
            'command',
78
            'contains',
79
            'not-contains',
80
            'empty',
81
            'not-empty',
82
            'begins-with',
83
            'ends-with',
84
            'bigger-than',
85
            'smaller-than',
86
            'equals-number'
87
        );
88
    }
89
    
90
    public function getDefaultType() : string
91
    {
92
        return 'command';
93
    }
94
}
95