Passed
Push — master ( 19aa6f...a676bf )
by Sebastian
03:24
created

Mailcode_Commands_Command_If_ListNotContains   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 16
rs 10
wmc 2

2 Methods

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