Test Failed
Push — master ( 36c5b6...af11e6 )
by Sebastian
04:51
created
src/Mailcode/Parser/Statement/Validator/Type/StringLiteral.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     
35 35
     public function getToken() : Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral
36 36
     {
37
-        if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral)
37
+        if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral)
38 38
         {
39 39
             return $this->token;
40 40
         }
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Validator/Type/Operand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     
42 42
     protected function _isMatch(Mailcode_Parser_Statement_Tokenizer_Token $token) : bool
43 43
     {
44
-        if(!empty($this->sign) && $token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
44
+        if (!empty($this->sign) && $token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
45 45
         {
46 46
             return $token->getSign() === $this->sign;
47 47
         }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     
52 52
     public function getToken() : Mailcode_Parser_Statement_Tokenizer_Token_Operand
53 53
     {
54
-        if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
54
+        if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
55 55
         {
56 56
             return $this->token;
57 57
         }
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@
 block discarded – undo
22 22
 {
23 23
     public const ERROR_NO_OPERAND_TOKEN_FOUND = 62901;
24 24
     
25
-   /**
26
-    * @var string
27
-    */
25
+    /**
26
+     * @var string
27
+     */
28 28
     private $sign = '';
29 29
     
30 30
     protected function getTokenClass() : string
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Validator/Type/Variable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     
35 35
     public function getToken() : Mailcode_Parser_Statement_Tokenizer_Token_Variable
36 36
     {
37
-        if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable)
37
+        if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable)
38 38
         {
39 39
             return $this->token;
40 40
         }
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Tokenizer/Token/StringLiteral.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,28 +20,28 @@
 block discarded – undo
20 20
  */
21 21
 class Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral extends Mailcode_Parser_Statement_Tokenizer_Token implements Mailcode_Parser_Statement_Tokenizer_ValueInterface
22 22
 {
23
-   /**
24
-    * Retrieves the text with the surrounding quotes.
25
-    * @return string
26
-    */
23
+    /**
24
+     * Retrieves the text with the surrounding quotes.
25
+     * @return string
26
+     */
27 27
     public function getNormalized() : string
28 28
     {
29 29
         return $this->restoreQuotes($this->matchedText);
30 30
     }
31 31
     
32
-   /**
33
-    * Retrieves the text with the surrounding quotes.
34
-    * @return string
35
-    */
32
+    /**
33
+     * Retrieves the text with the surrounding quotes.
34
+     * @return string
35
+     */
36 36
     public function getValue() : string
37 37
     {
38 38
         return $this->getNormalized();
39 39
     }
40 40
     
41
-   /**
42
-    * Retrieves the text without the surrounding quotes.
43
-    * @return string
44
-    */
41
+    /**
42
+     * Retrieves the text without the surrounding quotes.
43
+     * @return string
44
+     */
45 45
     public function getText() : string
46 46
     {
47 47
         $quoteless = trim($this->matchedText, '"\'');
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/SetVariable.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,8 +76,7 @@
 block discarded – undo
76 76
         if($val->isValid())
77 77
         {
78 78
             $this->variableToken = $val->getToken();
79
-        }
80
-        else
79
+        } else
81 80
         {
82 81
             $this->validationResult->makeError(
83 82
                 'The first parameter must be a variable name.',
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
  */
21 21
 class Mailcode_Commands_Command_SetVariable extends Mailcode_Commands_Command implements Mailcode_Commands_Command_Type_Standalone
22 22
 {
23
-   /**
24
-    * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL
25
-    */
23
+    /**
24
+     * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL
25
+     */
26 26
     private $variableToken;
27 27
     
28 28
     public function getName() : string
@@ -153,9 +153,9 @@  discard block
 block discarded – undo
153 153
         );
154 154
     }
155 155
     
156
-   /**
157
-    * @return Mailcode_Parser_Statement_Tokenizer_Token[]
158
-    */
156
+    /**
157
+     * @return Mailcode_Parser_Statement_Tokenizer_Token[]
158
+     */
159 159
     public function getAssignmentTokens() : array
160 160
     {
161 161
         $params = $this->requireParams()->getInfo()->getTokens();
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $val = $this->getValidator()->createVariable()->setIndex(0);
80 80
         
81
-        if($val->isValid())
81
+        if ($val->isValid())
82 82
         {
83 83
             $this->variableToken = $val->getToken();
84 84
         }
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
             ->limitToOperands()
100 100
             ->getTokens();
101 101
 
102
-        foreach($tokens as $token)
102
+        foreach ($tokens as $token)
103 103
         {
104
-            if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
104
+            if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
105 105
             {
106 106
                 $this->validateOperand($token);
107 107
             }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         
118 118
         // ensure that the operand we have in the command is one of the
119 119
         // allowed ones.
120
-        if(!in_array($sign, $allowed))
120
+        if (!in_array($sign, $allowed))
121 121
         {
122 122
             $this->validationResult->makeError(
123 123
                 t('The %1$s sign is not allowed in this command.', '<code>'.$sign.'</code>'),
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         $tokens = $this->getAssignmentTokens();
132 132
         
133
-        if(empty($tokens))
133
+        if (empty($tokens))
134 134
         {
135 135
             $this->validationResult->makeError(
136 136
                 t('No value assigned to the variable.'),
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     
142 142
     public function getVariable() : Mailcode_Variables_Variable
143 143
     {
144
-        if($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable)
144
+        if ($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable)
145 145
         {
146 146
             return $this->variableToken->getVariable();
147 147
         }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         $eq = array_shift($params); // equals sign
166 166
         
167 167
         // in case the equals sign was omitted.
168
-        if($eq !== null && !$eq instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
168
+        if ($eq !== null && !$eq instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
169 169
         {
170 170
             array_unshift($params, $eq);
171 171
         }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         
180 180
         $items = array();
181 181
         
182
-        foreach($tokens as $token)
182
+        foreach ($tokens as $token)
183 183
         {
184 184
             $items[] = $token->getNormalized();
185 185
         }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/IfVariable.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@
 block discarded – undo
36 36
         );
37 37
     }
38 38
     
39
-   /**
40
-    * @return array<string>
41
-    */
39
+    /**
40
+     * @return array<string>
41
+     */
42 42
     protected function getAllowedOperands() : array
43 43
     {
44 44
         return Mailcode_Parser_Statement_Tokenizer_Token_Operand::getComparisonSigns();
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/SearchTerm.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $val = $this->validator->createStringLiteral();
35 35
         
36
-        if($val->isValid())
36
+        if ($val->isValid())
37 37
         {
38 38
             $this->searchTerm = $val->getToken();
39 39
         }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     
49 49
     public function getSearchTerm() : string
50 50
     {
51
-        if($this->searchTerm instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral)
51
+        if ($this->searchTerm instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral)
52 52
         {
53 53
             return $this->searchTerm->getNormalized();
54 54
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@
 block discarded – undo
36 36
         if($val->isValid())
37 37
         {
38 38
             $this->searchTerm = $val->getToken();
39
-        }
40
-        else
39
+        } else
41 40
         {
42 41
             $this->validationResult->makeError(
43 42
                 t('No search term specified.'),
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/Value.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
  */
25 25
 trait Mailcode_Traits_Commands_Validation_Value
26 26
 {
27
-   /**
28
-    * @var Mailcode_Parser_Statement_Tokenizer_ValueInterface|NULL
29
-    */
27
+    /**
28
+     * @var Mailcode_Parser_Statement_Tokenizer_ValueInterface|NULL
29
+     */
30 30
     protected $valueToken;
31 31
     
32 32
     protected function validateSyntax_value() : void
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
         }
47 47
     }
48 48
     
49
-   /**
50
-    * Retrieves the variable being compared.
51
-    *
52
-    * @return string
53
-    */
49
+    /**
50
+     * Retrieves the variable being compared.
51
+     *
52
+     * @return string
53
+     */
54 54
     public function getValue() : string
55 55
     {
56 56
         if($this->valueToken instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $var = $this->validator->createValue();
35 35
         
36
-        if($var->isValid())
36
+        if ($var->isValid())
37 37
         {
38 38
             $this->valueToken = $var->getToken();
39 39
         }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     */
54 54
     public function getValue() : string
55 55
     {
56
-        if($this->valueToken instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface)
56
+        if ($this->valueToken instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface)
57 57
         {
58 58
             return $this->valueToken->getValue();
59 59
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@
 block discarded – undo
36 36
         if($var->isValid())
37 37
         {
38 38
             $this->valueToken = $var->getToken();
39
-        }
40
-        else
39
+        } else
41 40
         {
42 41
             $this->validationResult->makeError(
43 42
                 t('No value has been specified.'),
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/Operand.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
  */
26 26
 trait Mailcode_Traits_Commands_Validation_Operand
27 27
 {
28
-   /**
29
-    * @var Mailcode_Parser_Statement_Tokenizer_Token_Operand|NULL
30
-    */
28
+    /**
29
+     * @var Mailcode_Parser_Statement_Tokenizer_Token_Operand|NULL
30
+     */
31 31
     protected $operandToken;
32 32
     
33
-   /**
34
-    * @return string[]
35
-    */
33
+    /**
34
+     * @return string[]
35
+     */
36 36
     abstract protected function getAllowedOperands() : array;
37 37
     
38 38
     protected function validateSyntax_operand() : void
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
         );
79 79
     }
80 80
     
81
-   /**
82
-    * Retrieves the operand sign.
83
-    *
84
-    * @return string
85
-    */
81
+    /**
82
+     * Retrieves the operand sign.
83
+     *
84
+     * @return string
85
+     */
86 86
     public function getSign() : string
87 87
     {
88 88
         return $this->getOperand()->getSign();
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $var = $this->validator->createOperand();
41 41
         
42
-        if($var->isValid())
42
+        if ($var->isValid())
43 43
         {
44
-            if(in_array($var->getSign(), $this->getAllowedOperands()))
44
+            if (in_array($var->getSign(), $this->getAllowedOperands()))
45 45
             {
46 46
                 $this->operandToken = $var->getToken();
47 47
             }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     
67 67
     public function getOperand() : Mailcode_Parser_Statement_Tokenizer_Token_Operand
68 68
     {
69
-        if($this->operandToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
69
+        if ($this->operandToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
70 70
         {
71 71
             return $this->operandToken;
72 72
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@  discard block
 block discarded – undo
44 44
             if(in_array($var->getSign(), $this->getAllowedOperands()))
45 45
             {
46 46
                 $this->operandToken = $var->getToken();
47
-            }
48
-            else
47
+            } else
49 48
             {
50 49
                 $this->validationResult->makeError(
51 50
                     t('Invalid operand %1$s.', $var->getSign()).' '.
@@ -54,8 +53,7 @@  discard block
 block discarded – undo
54 53
                     Mailcode_Commands_CommonConstants::VALIDATION_INVALID_OPERAND
55 54
                 );
56 55
             }
57
-        }
58
-        else
56
+        } else
59 57
         {
60 58
             $this->validationResult->makeError(
61 59
                 t('No operand has been specified.'),
Please login to merge, or discard this patch.