Passed
Push — master ( 1515ff...7c0b30 )
by Sebastian
04:21
created
src/Mailcode/Parser/Statement/Validator/Type/Operand.php 1 patch
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.
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/Commands/Command.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     */
99 99
     private $validated = false;
100 100
     
101
-    public function __construct(string $type='', string $paramsString='', string $matchedText='')
101
+    public function __construct(string $type = '', string $paramsString = '', string $matchedText = '')
102 102
     {
103 103
         $this->type = $type;
104 104
         $this->paramsString = html_entity_decode($paramsString);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     {
173 173
         $this->requireNonDummy();
174 174
         
175
-        if($this->hash === '') {
175
+        if ($this->hash === '') {
176 176
             $this->hash = md5($this->matchedText);
177 177
         }
178 178
         
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     
182 182
     protected function requireNonDummy() : void
183 183
     {
184
-        if(!$this->isDummy())
184
+        if (!$this->isDummy())
185 185
         {
186 186
             return;
187 187
         }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     
201 201
     protected function validate() : \AppUtils\OperationResult
202 202
     {
203
-        if(!$this->validated)
203
+        if (!$this->validated)
204 204
         {
205 205
             $this->requireNonDummy();
206 206
             $this->validateSyntax();
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     
214 214
     public function getValidationResult() :  \AppUtils\OperationResult
215 215
     {
216
-        if(isset($this->validationResult)) 
216
+        if (isset($this->validationResult)) 
217 217
         {
218 218
             return $this->validationResult;
219 219
         }
@@ -229,10 +229,10 @@  discard block
 block discarded – undo
229 229
     {
230 230
         $validations = array_merge($this->validations, $this->getValidations());
231 231
         
232
-        foreach($validations as $validation)
232
+        foreach ($validations as $validation)
233 233
         {
234 234
             // break off at the first validation issue
235
-            if(!$this->validateSyntaxMethod($validation))
235
+            if (!$this->validateSyntaxMethod($validation))
236 236
             {
237 237
                 return;
238 238
             }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     {
244 244
         $method = 'validateSyntax_'.$validation;
245 245
         
246
-        if(!method_exists($this, $method))
246
+        if (!method_exists($this, $method))
247 247
         {
248 248
             throw new Mailcode_Exception(
249 249
                 'Missing validation method ['.$validation.']',
@@ -268,12 +268,12 @@  discard block
 block discarded – undo
268 268
     
269 269
     protected function validateSyntax_params_empty() : void
270 270
     {
271
-        if(!$this->requiresParameters())
271
+        if (!$this->requiresParameters())
272 272
         {
273 273
             return;
274 274
         }
275 275
         
276
-        if(empty($this->paramsString))
276
+        if (empty($this->paramsString))
277 277
         {
278 278
             $this->validationResult->makeError(
279 279
                 t('Parameters have to be specified.'),
@@ -285,14 +285,14 @@  discard block
 block discarded – undo
285 285
     
286 286
     protected function validateSyntax_params_keywords() : void
287 287
     {
288
-        if(!$this->supportsLogicKeywords())
288
+        if (!$this->supportsLogicKeywords())
289 289
         {
290 290
             return;
291 291
         }
292 292
         
293 293
         $this->logicKeywords = new Mailcode_Commands_LogicKeywords($this, $this->paramsString);
294 294
         
295
-        if(!$this->logicKeywords->isValid())
295
+        if (!$this->logicKeywords->isValid())
296 296
         {
297 297
             $this->validationResult->makeError(
298 298
                 t('Invalid parameters:').' '.$this->logicKeywords->getErrorMessage(),
@@ -307,14 +307,14 @@  discard block
 block discarded – undo
307 307
     
308 308
     protected function validateSyntax_params_parse() : void
309 309
     {
310
-        if(!$this->requiresParameters())
310
+        if (!$this->requiresParameters())
311 311
         {
312 312
             return;
313 313
         }
314 314
         
315 315
         $this->params = $this->mailcode->getParser()->createStatement($this->paramsString);
316 316
         
317
-        if(!$this->params->isValid())
317
+        if (!$this->params->isValid())
318 318
         {
319 319
             $error = $this->params->getValidationResult();
320 320
             
@@ -331,14 +331,14 @@  discard block
 block discarded – undo
331 331
     
332 332
     protected function validateSyntax_type_supported() : void
333 333
     {
334
-        if(!$this->supportsType() || empty($this->type))
334
+        if (!$this->supportsType() || empty($this->type))
335 335
         {
336 336
             return;
337 337
         }
338 338
         
339 339
         $types = $this->getSupportedTypes();
340 340
 
341
-        if(!in_array($this->type, $types))
341
+        if (!in_array($this->type, $types))
342 342
         {
343 343
             $this->validationResult->makeError(
344 344
                 t('The command addon %1$s is not supported.', $this->type).' '.
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
     
353 353
     protected function validateSyntax_type_unsupported() : void
354 354
     {
355
-        if($this->supportsType() || empty($this->type))
355
+        if ($this->supportsType() || empty($this->type))
356 356
         {
357 357
             return;
358 358
         }
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
     
371 371
     public function getType() : string
372 372
     {
373
-        if($this->supportsType())
373
+        if ($this->supportsType())
374 374
         {
375 375
             return $this->type;
376 376
         }
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
     
391 391
     public function getHighlighted() : string
392 392
     {
393
-        if(!$this->isValid())
393
+        if (!$this->isValid())
394 394
         {
395 395
             return '';
396 396
         }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
     
402 402
     public function getParamsString() : string
403 403
     {
404
-        if($this->requiresParameters())
404
+        if ($this->requiresParameters())
405 405
         {
406 406
             return $this->paramsString;
407 407
         }
@@ -436,22 +436,22 @@  discard block
 block discarded – undo
436 436
     
437 437
     public final function getCommandType() : string
438 438
     {
439
-        if($this instanceof Mailcode_Commands_Command_Type_Closing)
439
+        if ($this instanceof Mailcode_Commands_Command_Type_Closing)
440 440
         {
441 441
             return 'Closing';
442 442
         }
443 443
         
444
-        if($this instanceof Mailcode_Commands_Command_Type_Opening)
444
+        if ($this instanceof Mailcode_Commands_Command_Type_Opening)
445 445
         {
446 446
             return 'Opening';
447 447
         }
448 448
         
449
-        if($this instanceof Mailcode_Commands_Command_Type_Sibling)
449
+        if ($this instanceof Mailcode_Commands_Command_Type_Sibling)
450 450
         {
451 451
             return 'Sibling';
452 452
         }
453 453
         
454
-        if($this instanceof Mailcode_Commands_Command_Type_Standalone)
454
+        if ($this instanceof Mailcode_Commands_Command_Type_Standalone)
455 455
         {
456 456
             return 'Standalone';
457 457
         }
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
     
502 502
     public function getLogicKeywords() : Mailcode_Commands_LogicKeywords
503 503
     {
504
-        if($this->supportsLogicKeywords() && isset($this->logicKeywords))
504
+        if ($this->supportsLogicKeywords() && isset($this->logicKeywords))
505 505
         {
506 506
             return $this->logicKeywords;
507 507
         }
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/SetVariable.php 1 patch
Spacing   +5 added lines, -5 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,7 +90,7 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $val = $this->validator->createOperand('=')->setIndex(1);
92 92
         
93
-        if(!$val->isValid())
93
+        if (!$val->isValid())
94 94
         {
95 95
             $this->validationResult->makeError(
96 96
                 t('The second parameter must be an equals sign (%1$s).', '<code>=</code>'),
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     {
104 104
         $tokens = $this->getAssignmentTokens();
105 105
         
106
-        if(empty($tokens))
106
+        if (empty($tokens))
107 107
         {
108 108
             $this->validationResult->makeError(
109 109
                 t('No value assigned to the variable.'),
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     
115 115
     public function getVariable() : Mailcode_Variables_Variable
116 116
     {
117
-        if($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable)
117
+        if ($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable)
118 118
         {
119 119
             return $this->variableToken->getVariable();
120 120
         }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         
146 146
         $items = array();
147 147
         
148
-        foreach($tokens as $token)
148
+        foreach ($tokens as $token)
149 149
         {
150 150
             $items[] = $token->getNormalized();
151 151
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/If.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
  */
21 21
 class Mailcode_Factory_CommandSets_Set_If extends Mailcode_Factory_CommandSets_IfBase
22 22
 {
23
-    public function if(string $condition, string $type='') : Mailcode_Commands_Command_If
23
+    public function if (string $condition, string $type = '') : Mailcode_Commands_Command_If
24 24
     {
25 25
         $command = $this->instantiator->buildIf('If', $condition, $type);
26 26
         
27
-        if($command instanceof Mailcode_Commands_Command_If)
27
+        if ($command instanceof Mailcode_Commands_Command_If)
28 28
         {
29 29
             return $command;
30 30
         }
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
         throw $this->instantiator->exceptionUnexpectedType('If', $command);
33 33
     }
34 34
     
35
-    public function ifVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable
35
+    public function ifVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable
36 36
     {
37 37
         $command = $this->instantiator->buildIfVar('If', $variable, $operand, $value, $quoteValue);
38 38
         
39
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
39
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
40 40
         {
41 41
             return $command;
42 42
         }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     {
49 49
         $command = $this->instantiator->buildIfVar('If', $variable, $operand, $value, true);
50 50
         
51
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
51
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
52 52
         {
53 53
             return $command;
54 54
         }
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
         throw $this->instantiator->exceptionUnexpectedType('IfVarString', $command);
57 57
     }
58 58
     
59
-    public function ifVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable
59
+    public function ifVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable
60 60
     {
61 61
         $command = $this->instantiator->buildIfVar('If', $variable, '==', $value, $quoteValue);
62 62
         
63
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
63
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
64 64
         {
65 65
             return $command;
66 66
         }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $command = $this->instantiator->buildIfVar('If', $variable, '==', $value, true);
74 74
         
75
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
75
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
76 76
         {
77 77
             return $command;
78 78
         }
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
         throw $this->instantiator->exceptionUnexpectedType('IfarEqualsString', $command);
81 81
     }
82 82
     
83
-    public function ifVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable
83
+    public function ifVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable
84 84
     {
85 85
         $command = $this->instantiator->buildIfVar('If', $variable, '!=', $value, $quoteValue);
86 86
         
87
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
87
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
88 88
         {
89 89
             return $command;
90 90
         }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     {
97 97
         $command = $this->instantiator->buildIfVar('If', $variable, '!=', $value, true);
98 98
         
99
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
99
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
100 100
         {
101 101
             return $command;
102 102
         }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $command = $this->instantiator->buildIfEmpty('If', $variable);
110 110
         
111
-        if($command instanceof Mailcode_Commands_Command_If_Empty)
111
+        if ($command instanceof Mailcode_Commands_Command_If_Empty)
112 112
         {
113 113
             return $command;
114 114
         }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $command = $this->instantiator->buildIfNotEmpty('If', $variable);
122 122
         
123
-        if($command instanceof Mailcode_Commands_Command_If_NotEmpty)
123
+        if ($command instanceof Mailcode_Commands_Command_If_NotEmpty)
124 124
         {
125 125
             return $command;
126 126
         }
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
         throw $this->instantiator->exceptionUnexpectedType('IfNotEmpty', $command);
129 129
     }
130 130
     
131
-    public function ifContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains
131
+    public function ifContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_Contains
132 132
     {
133 133
         $command = $this->instantiator->buildIfContains('If', $variable, $search, $caseInsensitive);
134 134
         
135
-        if($command instanceof Mailcode_Commands_Command_If_Contains)
135
+        if ($command instanceof Mailcode_Commands_Command_If_Contains)
136 136
         {
137 137
             return $command;
138 138
         }
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
         throw $this->instantiator->exceptionUnexpectedType('IfContains', $command);
141 141
     }
142 142
     
143
-    public function ifBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_BeginsWith
143
+    public function ifBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_BeginsWith
144 144
     {
145 145
         $command = $this->instantiator->buildIfBeginsWith('If', $variable, $search, $caseInsensitive);
146 146
         
147
-        if($command instanceof Mailcode_Commands_Command_If_BeginsWith)
147
+        if ($command instanceof Mailcode_Commands_Command_If_BeginsWith)
148 148
         {
149 149
             return $command;
150 150
         }
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
         throw $this->instantiator->exceptionUnexpectedType('IfBeginsWith', $command);
153 153
     }
154 154
     
155
-    public function ifEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_EndsWith
155
+    public function ifEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_EndsWith
156 156
     {
157 157
         $command = $this->instantiator->buildIfEndsWith('If', $variable, $search, $caseInsensitive);
158 158
         
159
-        if($command instanceof Mailcode_Commands_Command_If_EndsWith)
159
+        if ($command instanceof Mailcode_Commands_Command_If_EndsWith)
160 160
         {
161 161
             return $command;
162 162
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/ElseIf.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
  */
21 21
 class Mailcode_Factory_CommandSets_Set_ElseIf extends Mailcode_Factory_CommandSets_IfBase
22 22
 {
23
-    public function elseIf(string $condition, string $type='') : Mailcode_Commands_Command_ElseIf
23
+    public function elseIf (string $condition, string $type = '') : Mailcode_Commands_Command_ElseIf
24 24
     {
25 25
         $command = $this->instantiator->buildIf('ElseIf', $condition, $type);
26 26
         
27
-        if($command instanceof Mailcode_Commands_Command_ElseIf)
27
+        if ($command instanceof Mailcode_Commands_Command_ElseIf)
28 28
         {
29 29
             return $command;
30 30
         }
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
         throw $this->instantiator->exceptionUnexpectedType('ElseIf', $command);
33 33
     }
34 34
     
35
-    public function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable
35
+    public function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable
36 36
     {
37 37
         $command = $this->instantiator->buildIfVar('ElseIf', $variable, $operand, $value, $quoteValue);
38 38
         
39
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
39
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
40 40
         {
41 41
             return $command;
42 42
         }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     {
49 49
         $command = $this->instantiator->buildIfVar('ElseIf', $variable, $operand, $value, true);
50 50
         
51
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
51
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
52 52
         {
53 53
             return $command;
54 54
         }
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
         throw $this->instantiator->exceptionUnexpectedType('ElseIfVarString', $command);
57 57
     }
58 58
     
59
-    public function elseIfVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable
59
+    public function elseIfVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable
60 60
     {
61 61
         $command = $this->instantiator->buildIfVar('ElseIf', $variable, '==', $value, $quoteValue);
62 62
         
63
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
63
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
64 64
         {
65 65
             return $command;
66 66
         }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $command = $this->instantiator->buildIfVar('ElseIf', $variable, '==', $value, true);
74 74
         
75
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
75
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
76 76
         {
77 77
             return $command;
78 78
         }
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
         throw $this->instantiator->exceptionUnexpectedType('ElseIfVarEqualsString', $command);
81 81
     }
82 82
     
83
-    public function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable
83
+    public function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable
84 84
     {
85 85
         $command = $this->instantiator->buildIfVar('ElseIf', $variable, '!=', $value, $quoteValue);
86 86
         
87
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
87
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
88 88
         {
89 89
             return $command;
90 90
         }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     {
97 97
         $command = $this->instantiator->buildIfVar('ElseIf', $variable, '!=', $value, true);
98 98
         
99
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
99
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
100 100
         {
101 101
             return $command;
102 102
         }
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
         throw $this->instantiator->exceptionUnexpectedType('ElseIfVarNotEqualsString', $command);
105 105
     }
106 106
     
107
-    public function elseIfContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains
107
+    public function elseIfContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains
108 108
     {
109 109
         $command = $this->instantiator->buildIfContains('ElseIf', $variable, $search, $caseInsensitive);
110 110
         
111
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Contains)
111
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Contains)
112 112
         {
113 113
             return $command;
114 114
         }
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
         throw $this->instantiator->exceptionUnexpectedType('ElseIfContains', $command);
117 117
     }
118 118
     
119
-    public function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_BeginsWith
119
+    public function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_BeginsWith
120 120
     {
121 121
         $command = $this->instantiator->buildIfBeginsWith('ElseIf', $variable, $search, $caseInsensitive);
122 122
         
123
-        if($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith)
123
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith)
124 124
         {
125 125
             return $command;
126 126
         }
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
         throw $this->instantiator->exceptionUnexpectedType('ElseIfBeginsWith', $command);
129 129
     }
130 130
     
131
-    public function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_EndsWith
131
+    public function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_EndsWith
132 132
     {
133 133
         $command = $this->instantiator->buildIfEndsWith('ElseIf', $variable, $search, $caseInsensitive);
134 134
         
135
-        if($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith)
135
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith)
136 136
         {
137 137
             return $command;
138 138
         }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     {
145 145
         $command = $this->instantiator->buildIfEmpty('ElseIf', $variable);
146 146
         
147
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Empty)
147
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Empty)
148 148
         {
149 149
             return $command;
150 150
         }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     {
157 157
         $command = $this->instantiator->buildIfNotEmpty('ElseIf', $variable);
158 158
         
159
-        if($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty)
159
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty)
160 160
         {
161 161
             return $command;
162 162
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/Instantiator.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
  */
21 21
 class Mailcode_Factory_Instantiator
22 22
 {
23
-    public function buildIf(string $ifType, string $params, string $type='') : Mailcode_Commands_IfBase
23
+    public function buildIf(string $ifType, string $params, string $type = '') : Mailcode_Commands_IfBase
24 24
     {
25 25
         $stringType = $type;
26 26
         
27
-        if(!empty($type))
27
+        if (!empty($type))
28 28
         {
29 29
             $stringType = ' '.$type;
30 30
         }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         
44 44
         $this->checkCommand($command);
45 45
         
46
-        if($command instanceof Mailcode_Commands_IfBase)
46
+        if ($command instanceof Mailcode_Commands_IfBase)
47 47
         {
48 48
             return $command;
49 49
         }
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
         throw $this->exceptionUnexpectedType('IfBase', $command);
52 52
     }
53 53
     
54
-    public function buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_IfBase
54
+    public function buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_IfBase
55 55
     {
56
-        if($quoteValue)
56
+        if ($quoteValue)
57 57
         {
58 58
             $value = $this->quoteString($value);
59 59
         }
@@ -78,26 +78,26 @@  discard block
 block discarded – undo
78 78
         return $this->buildIf($ifType, $this->filterVariableName($variable), 'not-empty');
79 79
     }
80 80
     
81
-    public function buildIfContains(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
81
+    public function buildIfContains(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
82 82
     {
83 83
         return $this->buildIfSearch($ifType, 'contains', $variable, $search, $caseInsensitive);
84 84
     }
85 85
     
86
-    public function buildIfBeginsWith(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
86
+    public function buildIfBeginsWith(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
87 87
     {
88 88
         return $this->buildIfSearch($ifType, 'begins-with', $variable, $search, $caseInsensitive);
89 89
     }
90 90
     
91
-    public function buildIfEndsWith(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
91
+    public function buildIfEndsWith(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
92 92
     {
93 93
         return $this->buildIfSearch($ifType, 'ends-with', $variable, $search, $caseInsensitive);
94 94
     }
95 95
     
96
-    private function buildIfSearch(string $ifType, string $subType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
96
+    private function buildIfSearch(string $ifType, string $subType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
97 97
     {
98 98
         $keyword = ' ';
99 99
         
100
-        if($caseInsensitive)
100
+        if ($caseInsensitive)
101 101
         {
102 102
             $keyword = ' insensitive: ';
103 103
         }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     
122 122
     public function checkCommand(Mailcode_Commands_Command $command) : void
123 123
     {
124
-        if($command->isValid())
124
+        if ($command->isValid())
125 125
         {
126 126
             return;
127 127
         }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/SearchTerm.php 1 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
         $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.
src/Mailcode/Traits/Commands/Validation/Value.php 1 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.