Passed
Push — master ( deb6f9...02717f )
by Sebastian
03:13
created
src/Mailcode/Parser/Safeguard/Placeholder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
     
70 70
     public function getReplacementText() : string
71 71
     {
72
-        if(!empty($this->replacement))
72
+        if (!empty($this->replacement))
73 73
         {
74 74
             return $this->replacement;
75 75
         }
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/ApacheVelocity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
         
70 70
         // All other special characters have to be escaped
71 71
         // with two backslashes. 
72
-        foreach($this->regexSpecialChars as $char)
72
+        foreach ($this->regexSpecialChars as $char)
73 73
         {
74 74
             $string = str_replace($char, '\\'.$char, $string);
75 75
         }
Please login to merge, or discard this patch.
src/Mailcode/Collection.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     */
54 54
     public function addCommand(Mailcode_Commands_Command $command) : Mailcode_Collection
55 55
     {
56
-        if($this->finalized)
56
+        if ($this->finalized)
57 57
         {
58 58
             throw new Mailcode_Exception(
59 59
                 'Cannot add commands to a finalized collection',
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
     {
113 113
         $keep = array();
114 114
 
115
-        foreach($this->commands as $existing)
115
+        foreach ($this->commands as $existing)
116 116
         {
117
-            if($existing !== $command)
117
+            if ($existing !== $command)
118 118
             {
119 119
                 $keep[] = $existing;
120 120
             }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         
133 133
         $errors = $this->errors;
134 134
         
135
-        if(!$result->isValid())
135
+        if (!$result->isValid())
136 136
         {
137 137
             $errors[] = new Mailcode_Collection_Error_Message(
138 138
                 '',
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     {
149 149
         $errors = $this->getErrors();
150 150
         
151
-        if(!empty($errors))
151
+        if (!empty($errors))
152 152
         {
153 153
             return array_shift($errors);
154 154
         }
@@ -190,11 +190,11 @@  discard block
 block discarded – undo
190 190
     {
191 191
         $hashes = array();
192 192
         
193
-        foreach($this->commands as $command)
193
+        foreach ($this->commands as $command)
194 194
         {
195 195
             $hash = $command->getHash();
196 196
             
197
-            if(!isset($hashes[$hash]))
197
+            if (!isset($hashes[$hash]))
198 198
             {
199 199
                 $hashes[$hash] = $command;
200 200
             }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     */
212 212
     public function addCommands(array $commands) : Mailcode_Collection
213 213
     {
214
-        foreach($commands as $command)
214
+        foreach ($commands as $command)
215 215
         {
216 216
             $this->addCommand($command);
217 217
         }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
     {
233 233
         $collection = new Mailcode_Variables_Collection_Regular();
234 234
         
235
-        foreach($this->commands as $command)
235
+        foreach ($this->commands as $command)
236 236
         {
237 237
             $collection->mergeWith($command->getVariables());
238 238
         }
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     
243 243
     public function getValidationResult() : OperationResult
244 244
     {
245
-        if($this->validationResult instanceof OperationResult)
245
+        if ($this->validationResult instanceof OperationResult)
246 246
         {
247 247
             return $this->validationResult;
248 248
         }
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
     {
259 259
         $errors = $this->getErrors();
260 260
         
261
-        foreach($errors as $error)
261
+        foreach ($errors as $error)
262 262
         {
263
-            if($error->getCode() === $code)
263
+            if ($error->getCode() === $code)
264 264
             {
265 265
                 return true;
266 266
             }
@@ -316,9 +316,9 @@  discard block
 block discarded – undo
316 316
     {
317 317
         $result = array();
318 318
 
319
-        foreach($this->commands as $command)
319
+        foreach ($this->commands as $command)
320 320
         {
321
-            if($command instanceof $className)
321
+            if ($command instanceof $className)
322 322
             {
323 323
                 $result[] = $command;
324 324
             }
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
     {
332 332
         $commands = $this->getCommands();
333 333
         
334
-        if(!empty($commands))
334
+        if (!empty($commands))
335 335
         {
336 336
             return array_shift($commands);
337 337
         }
@@ -353,11 +353,11 @@  discard block
 block discarded – undo
353 353
 
354 354
     private function validateNesting() : void
355 355
     {
356
-        foreach($this->commands as $command)
356
+        foreach ($this->commands as $command)
357 357
         {
358 358
             $command->validateNesting();
359 359
 
360
-            if(!$command->isValid()) {
360
+            if (!$command->isValid()) {
361 361
                 $this->addInvalidCommand($command);
362 362
             }
363 363
         }
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/Break.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
     protected function _validateNesting() : void
71 71
     {
72
-        if($this->findParentFor($this))
72
+        if ($this->findParentFor($this))
73 73
         {
74 74
             return;
75 75
         }
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
     {
85 85
         $parent = $command->getParent();
86 86
 
87
-        if($parent === null)
87
+        if ($parent === null)
88 88
         {
89 89
             return false;
90 90
         }
91 91
 
92
-        if($parent instanceof Mailcode_Commands_Command_For)
92
+        if ($parent instanceof Mailcode_Commands_Command_For)
93 93
         {
94 94
             return true;
95 95
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/Misc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     
35 35
         $this->instantiator->checkCommand($cmd);
36 36
         
37
-        if($cmd instanceof Mailcode_Commands_Command_Comment)
37
+        if ($cmd instanceof Mailcode_Commands_Command_Comment)
38 38
         {
39 39
             return $cmd;
40 40
         }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         throw $this->instantiator->exceptionUnexpectedType('Comment', $cmd);
43 43
     }
44 44
     
45
-    public function for(string $sourceVariable, string $loopVariable) : Mailcode_Commands_Command_For
45
+    public function for (string $sourceVariable, string $loopVariable) : Mailcode_Commands_Command_For
46 46
     {
47 47
         $sourceVariable = '$'.ltrim($sourceVariable, '$');
48 48
         $loopVariable = '$'.ltrim($loopVariable, '$');
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         
65 65
         $this->instantiator->checkCommand($cmd);
66 66
         
67
-        if($cmd instanceof Mailcode_Commands_Command_For)
67
+        if ($cmd instanceof Mailcode_Commands_Command_For)
68 68
         {
69 69
             return $cmd;
70 70
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         $this->instantiator->checkCommand($cmd);
85 85
 
86
-        if($cmd instanceof Mailcode_Commands_Command_Break)
86
+        if ($cmd instanceof Mailcode_Commands_Command_Break)
87 87
         {
88 88
             return $cmd;
89 89
         }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
         $this->instantiator->checkCommand($cmd);
110 110
 
111
-        if($cmd instanceof Mailcode_Commands_Command_Code)
111
+        if ($cmd instanceof Mailcode_Commands_Command_Code)
112 112
         {
113 113
             return $cmd;
114 114
         }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/EmptyParams.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
 
30 30
     protected function validateSyntax_params_empty() : void
31 31
     {
32
-        if(!$this->requiresParameters())
32
+        if (!$this->requiresParameters())
33 33
         {
34 34
             return;
35 35
         }
36 36
 
37
-        if(empty($this->paramsString))
37
+        if (empty($this->paramsString))
38 38
         {
39 39
             $this->validationResult->makeError(
40 40
                 t('Parameters have to be specified.'),
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/TypeSupported.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@
 block discarded – undo
35 35
 
36 36
     protected function validateSyntax_type_supported() : void
37 37
     {
38
-        if(!$this->supportsType() || empty($this->type))
38
+        if (!$this->supportsType() || empty($this->type))
39 39
         {
40 40
             return;
41 41
         }
42 42
 
43 43
         $types = $this->getSupportedTypes();
44 44
 
45
-        if(!in_array($this->type, $types))
45
+        if (!in_array($this->type, $types))
46 46
         {
47 47
             $this->validationResult->makeError(
48 48
                 t('The command addon %1$s is not supported.', $this->type).' '.
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/ParamKeywords.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,14 +31,14 @@
 block discarded – undo
31 31
 
32 32
     protected function validateSyntax_params_keywords() : void
33 33
     {
34
-        if(!$this->supportsLogicKeywords())
34
+        if (!$this->supportsLogicKeywords())
35 35
         {
36 36
             return;
37 37
         }
38 38
 
39 39
         $this->logicKeywords = new Mailcode_Commands_LogicKeywords($this, $this->paramsString);
40 40
 
41
-        if(!$this->logicKeywords->isValid())
41
+        if (!$this->logicKeywords->isValid())
42 42
         {
43 43
             $this->validationResult->makeError(
44 44
                 t('Invalid parameters:').' '.$this->logicKeywords->getErrorMessage(),
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/TypeUnsupported.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 
31 31
     protected function validateSyntax_type_unsupported() : void
32 32
     {
33
-        if($this->supportsType() || empty($this->type))
33
+        if ($this->supportsType() || empty($this->type))
34 34
         {
35 35
             return;
36 36
         }
Please login to merge, or discard this patch.