Passed
Push — master ( d3eb9e...ba3bb3 )
by Sebastian
03:58
created
src/Mailcode/Parser/Statement/Validator/Type.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
  */
21 21
 abstract class Mailcode_Parser_Statement_Validator_Type
22 22
 {
23
-   /**
24
-    * @var Mailcode_Parser_Statement
25
-    */
23
+    /**
24
+     * @var Mailcode_Parser_Statement
25
+     */
26 26
     protected $statement;
27 27
     
28 28
     /**
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
      */
31 31
     protected $params;
32 32
     
33
-   /**
34
-    * @var boolean
35
-    */
33
+    /**
34
+     * @var boolean
35
+     */
36 36
     private $valid = true;
37 37
     
38
-   /**
39
-    * @var boolean
40
-    */
38
+    /**
39
+     * @var boolean
40
+     */
41 41
     private $validated = false;
42 42
     
43 43
     public function __construct(Mailcode_Parser_Statement $statement)
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
         
54 54
     }
55 55
     
56
-   /**
57
-    * @return $this
58
-    */
56
+    /**
57
+     * @return $this
58
+     */
59 59
     public function validate() : Mailcode_Parser_Statement_Validator_Type
60 60
     {
61 61
         if(!$this->validated)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     */
59 59
     public function validate() : Mailcode_Parser_Statement_Validator_Type
60 60
     {
61
-        if(!$this->validated)
61
+        if (!$this->validated)
62 62
         {
63 63
             $this->valid = $this->_validate();
64 64
             $this->validated = true;
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Validator/Type/Keyword.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     
51 51
     public function getToken() : Mailcode_Parser_Statement_Tokenizer_Token_Keyword
52 52
     {
53
-        if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
53
+        if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
54 54
         {
55 55
             return $this->token;
56 56
         }
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@
 block discarded – undo
22 22
 {
23 23
     public const ERROR_NO_KEYWORD_TOKEN_FOUND = 62701;
24 24
     
25
-   /**
26
-    * The name of the keyword, with ":" appended.
27
-    * @var string
28
-    */
25
+    /**
26
+     * The name of the keyword, with ":" appended.
27
+     * @var string
28
+     */
29 29
     protected $keywordName;
30 30
     
31 31
     public function __construct(Mailcode_Parser_Statement $statement, string $keywordName)
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Validator/Type/Value.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_ValueInterface
36 36
     {
37
-        if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface)
37
+        if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface)
38 38
         {
39 39
             return $this->token;
40 40
         }
Please login to merge, or discard this patch.
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
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
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
         );
127 127
     }
128 128
     
129
-   /**
130
-    * @return Mailcode_Parser_Statement_Tokenizer_Token[]
131
-    */
129
+    /**
130
+     * @return Mailcode_Parser_Statement_Tokenizer_Token[]
131
+     */
132 132
     public function getAssignmentTokens() : array
133 133
     {
134 134
         $params = $this->params->getInfo()->getTokens();
Please login to merge, or discard this patch.
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.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         $val = $this->validator->createVariable()->setIndex(0);
75 75
         
76
-        if($val->isValid())
76
+        if ($val->isValid())
77 77
         {
78 78
             $this->variableToken = $val->getToken();
79 79
         }
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $tokens = $this->params->getInfo()->createPruner()->limitToOperands()->getTokens();
92 92
 
93
-        foreach($tokens as $token)
93
+        foreach ($tokens as $token)
94 94
         {
95
-            if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
95
+            if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
96 96
             {
97 97
                 $this->validateOperand($token);
98 98
             }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         
109 109
         // ensure that the operand we have in the command is one of the
110 110
         // allowed ones.
111
-        if(!in_array($sign, $allowed))
111
+        if (!in_array($sign, $allowed))
112 112
         {
113 113
             $this->validationResult->makeError(
114 114
                 t('The %1$s sign is not allowed in this command.', '<code>'.$sign.'</code>'),
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     {
122 122
         $tokens = $this->getAssignmentTokens();
123 123
         
124
-        if(empty($tokens))
124
+        if (empty($tokens))
125 125
         {
126 126
             $this->validationResult->makeError(
127 127
                 t('No value assigned to the variable.'),
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     
133 133
     public function getVariable() : Mailcode_Variables_Variable
134 134
     {
135
-        if($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable)
135
+        if ($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable)
136 136
         {
137 137
             return $this->variableToken->getVariable();
138 138
         }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         $eq = array_shift($params); // equals sign
157 157
         
158 158
         // in case the equals sign was omitted.
159
-        if(!$eq instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
159
+        if (!$eq instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand)
160 160
         {
161 161
             array_unshift($params, $eq);
162 162
         }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         
171 171
         $items = array();
172 172
         
173
-        foreach($tokens as $token)
173
+        foreach ($tokens as $token)
174 174
         {
175 175
             $items[] = $token->getNormalized();
176 176
         }
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.