Passed
Push — master ( 5d6ae0...deb6f9 )
by Sebastian
03:48
created

Mailcode_Commands_Command_ElseIf_ListNotContains   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A _collectListVariables() 0 3 1
A getValidations() 0 7 1
1
<?php
2
/**
3
 * File containing the {@see Mailcode_Commands_Command_ElseIf_ListNotContains} class.
4
 *
5
 * @package Mailcode
6
 * @subpackage Commands
7
 * @see Mailcode_Commands_Command_ElseIf_ListNotContains
8
 */
9
10
declare(strict_types=1);
11
12
namespace Mailcode;
13
14
/**
15
 * Mailcode command: opening ELSE IF LIST NOT CONTAINS statement.
16
 * 
17
 * Checks if a list variable value does not contain a search string.
18
 *
19
 * @package Mailcode
20
 * @subpackage Commands
21
 * @author Sebastian Mordziol <[email protected]>
22
 */
23
class Mailcode_Commands_Command_ElseIf_ListNotContains
24
    extends
25
        Mailcode_Commands_Command_ElseIf_NotContains
26
    implements
27
        Mailcode_Interfaces_Commands_ListVariables,
28
        Mailcode_Interfaces_Commands_ListPropertyVariable,
29
        Mailcode_Interfaces_Commands_RegexEnabled
30
{
31
    use Mailcode_Traits_Commands_ListVariables;
32
    use Mailcode_Traits_Commands_Validation_ListPropertyVariable;
33
    use Mailcode_Traits_Commands_Validation_RegexEnabled;
34
35
    protected function getValidations(): array
36
    {
37
        $validations = parent::getValidations();
38
        $validations[] = 'list_property_variable';
39
        $validations[] = 'regex_enabled';
40
41
        return $validations;
42
    }
43
44
    protected function _collectListVariables(Mailcode_Variables_Collection_Regular $collection): void
45
    {
46
        $collection->add($this->getListVariable());
47
    }
48
}
49