Passed
Push — master ( 174259...689687 )
by Sebastian
04:01
created
src/Mailcode/Commands/Command/ShowDate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,18 +56,18 @@
 block discarded – undo
56 56
          $token = $this->params->getInfo()->getTokenByIndex(1);
57 57
          
58 58
          // no format specified? Use the default one.
59
-         if($token === null)
59
+         if ($token === null)
60 60
          {
61 61
              return;
62 62
          }
63 63
          
64
-         if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral)
64
+         if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral)
65 65
          {
66 66
              $format = $token->getText();
67 67
              
68 68
              $result = $this->formatInfo->validateFormat($format);
69 69
              
70
-             if($result->isValid())
70
+             if ($result->isValid())
71 71
              {
72 72
                 $this->formatString = $format;
73 73
              }
Please login to merge, or discard this patch.
src/Mailcode/Factory.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         
49 49
         self::_checkCommand($cmd);
50 50
         
51
-        if($cmd instanceof Mailcode_Commands_Command_ShowVariable)
51
+        if ($cmd instanceof Mailcode_Commands_Command_ShowVariable)
52 52
         {
53 53
             return $cmd;
54 54
         }
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
      * @param string $formatString A date format string, or empty string for default.
65 65
      * @return Mailcode_Commands_Command_ShowDate
66 66
      */
67
-    public static function showDate(string $variableName, string $formatString="") : Mailcode_Commands_Command_ShowDate
67
+    public static function showDate(string $variableName, string $formatString = "") : Mailcode_Commands_Command_ShowDate
68 68
     {
69 69
         $variableName = self::_filterVariableName($variableName);
70 70
         
71 71
         $format = '';
72
-        if(!empty($formatString))
72
+        if (!empty($formatString))
73 73
         {
74 74
             $format = sprintf(
75 75
                 ' "%s"',
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         
91 91
         self::_checkCommand($cmd);
92 92
         
93
-        if($cmd instanceof Mailcode_Commands_Command_ShowDate)
93
+        if ($cmd instanceof Mailcode_Commands_Command_ShowDate)
94 94
         {
95 95
             return $cmd;
96 96
         }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         
119 119
         self::_checkCommand($cmd);
120 120
         
121
-        if($cmd instanceof Mailcode_Commands_Command_ShowSnippet)
121
+        if ($cmd instanceof Mailcode_Commands_Command_ShowSnippet)
122 122
         {
123 123
             return $cmd;
124 124
         }
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
     * 
138 138
     * @see Mailcode_Factory::ERROR_INVALID_COMMAND_CREATED
139 139
     */
140
-    public static function setVar(string $variableName, string $value, bool $quoteValue=true) : Mailcode_Commands_Command_SetVariable
140
+    public static function setVar(string $variableName, string $value, bool $quoteValue = true) : Mailcode_Commands_Command_SetVariable
141 141
     {
142 142
         $variableName = self::_filterVariableName($variableName);
143 143
         
144
-        if($quoteValue)
144
+        if ($quoteValue)
145 145
         {
146 146
             $value = self::_quoteString($value);
147 147
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         
158 158
         self::_checkCommand($cmd);
159 159
         
160
-        if($cmd instanceof Mailcode_Commands_Command_SetVariable)
160
+        if ($cmd instanceof Mailcode_Commands_Command_SetVariable)
161 161
         {
162 162
             return $cmd;
163 163
         }
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         
193 193
         self::_checkCommand($cmd);
194 194
         
195
-        if($cmd instanceof Mailcode_Commands_Command_Comment)
195
+        if ($cmd instanceof Mailcode_Commands_Command_Comment)
196 196
         {
197 197
             return $cmd;
198 198
         }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         
212 212
         self::_checkCommand($cmd);
213 213
         
214
-        if($cmd instanceof Mailcode_Commands_Command_Else)
214
+        if ($cmd instanceof Mailcode_Commands_Command_Else)
215 215
         {
216 216
             return $cmd;
217 217
         }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         
231 231
         self::_checkCommand($cmd);
232 232
         
233
-        if($cmd instanceof Mailcode_Commands_Command_End)
233
+        if ($cmd instanceof Mailcode_Commands_Command_End)
234 234
         {
235 235
             return $cmd;
236 236
         }
@@ -238,11 +238,11 @@  discard block
 block discarded – undo
238 238
         throw self::_exceptionUnexpectedType('End', $cmd);
239 239
     }
240 240
     
241
-    protected static function _buildIf(string $ifType, string $params, string $type='') : Mailcode_Commands_IfBase
241
+    protected static function _buildIf(string $ifType, string $params, string $type = '') : Mailcode_Commands_IfBase
242 242
     {
243 243
         $stringType = $type;
244 244
         
245
-        if(!empty($type))
245
+        if (!empty($type))
246 246
         {
247 247
             $stringType = ' '.$type;
248 248
         }
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         
262 262
         self::_checkCommand($command);
263 263
         
264
-        if($command instanceof Mailcode_Commands_IfBase)
264
+        if ($command instanceof Mailcode_Commands_IfBase)
265 265
         {
266 266
             return $command;
267 267
         }
@@ -269,9 +269,9 @@  discard block
 block discarded – undo
269 269
         throw self::_exceptionUnexpectedType('IfBase', $command);
270 270
     }
271 271
   
272
-    protected static function _buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_IfBase
272
+    protected static function _buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_IfBase
273 273
     {
274
-        if($quoteValue)
274
+        if ($quoteValue)
275 275
         {
276 276
             $value = self::_quoteString($value);
277 277
         }
@@ -286,11 +286,11 @@  discard block
 block discarded – undo
286 286
         return self::_buildIf($ifType, $condition, 'variable');
287 287
     }
288 288
     
289
-    public static function if(string $condition, string $type='') : Mailcode_Commands_Command_If
289
+    public static function if (string $condition, string $type = '') : Mailcode_Commands_Command_If
290 290
     {
291 291
         $command = self::_buildIf('If', $condition, $type);
292 292
         
293
-        if($command instanceof Mailcode_Commands_Command_If)
293
+        if ($command instanceof Mailcode_Commands_Command_If)
294 294
         {
295 295
             return $command;
296 296
         }
@@ -298,11 +298,11 @@  discard block
 block discarded – undo
298 298
         throw self::_exceptionUnexpectedType('If', $command);
299 299
     }
300 300
     
301
-    public static function ifVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable
301
+    public static function ifVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable
302 302
     {
303 303
         $command = self::_buildIfVar('If', $variable, $operand, $value, $quoteValue);
304 304
         
305
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
305
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
306 306
         {
307 307
             return $command;
308 308
         }
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
     {
315 315
         $command = self::_buildIfVar('If', $variable, $operand, $value, true);
316 316
         
317
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
317
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
318 318
         {
319 319
             return $command;
320 320
         }
@@ -322,11 +322,11 @@  discard block
 block discarded – undo
322 322
         throw self::_exceptionUnexpectedType('IfVarString', $command);
323 323
     }
324 324
     
325
-    public static function ifVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable
325
+    public static function ifVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable
326 326
     {
327 327
         $command = self::_buildIfVar('If', $variable, '==', $value, $quoteValue);
328 328
         
329
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
329
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
330 330
         {
331 331
             return $command;
332 332
         }
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
     {
339 339
         $command = self::_buildIfVar('If', $variable, '==', $value, true);
340 340
         
341
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
341
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
342 342
         {
343 343
             return $command;
344 344
         }
@@ -346,11 +346,11 @@  discard block
 block discarded – undo
346 346
         throw self::_exceptionUnexpectedType('IfarEqualsString', $command);
347 347
     }
348 348
     
349
-    public static function ifVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable
349
+    public static function ifVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable
350 350
     {
351 351
         $command = self::_buildIfVar('If', $variable, '!=', $value, $quoteValue);
352 352
         
353
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
353
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
354 354
         {
355 355
             return $command;
356 356
         }
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
     {
363 363
         $command = self::_buildIfVar('If', $variable, '!=', $value, true);
364 364
         
365
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
365
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
366 366
         {
367 367
             return $command;
368 368
         }
@@ -370,11 +370,11 @@  discard block
 block discarded – undo
370 370
         throw self::_exceptionUnexpectedType('IfVarNotEqualsString', $command);
371 371
     }
372 372
     
373
-    public static function elseIf(string $condition, string $type='') : Mailcode_Commands_Command_ElseIf
373
+    public static function elseIf (string $condition, string $type = '') : Mailcode_Commands_Command_ElseIf
374 374
     {
375 375
         $command = self::_buildIf('ElseIf', $condition, $type);
376 376
         
377
-        if($command instanceof Mailcode_Commands_Command_ElseIf)
377
+        if ($command instanceof Mailcode_Commands_Command_ElseIf)
378 378
         {
379 379
             return $command;
380 380
         }
@@ -382,11 +382,11 @@  discard block
 block discarded – undo
382 382
         throw self::_exceptionUnexpectedType('ElseIf', $command);
383 383
     }
384 384
     
385
-    public static function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable
385
+    public static function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable
386 386
     {
387 387
         $command = self::_buildIfVar('ElseIf', $variable, $operand, $value, $quoteValue);
388 388
         
389
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
389
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
390 390
         {
391 391
             return $command;
392 392
         }
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
     {
399 399
         $command = self::_buildIfVar('ElseIf', $variable, $operand, $value, true);
400 400
         
401
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
401
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
402 402
         {
403 403
             return $command;
404 404
         }
@@ -406,11 +406,11 @@  discard block
 block discarded – undo
406 406
         throw self::_exceptionUnexpectedType('ElseIfVarString', $command);
407 407
     }
408 408
     
409
-    public static function elseIfVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable
409
+    public static function elseIfVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable
410 410
     {
411 411
         $command = self::_buildIfVar('ElseIf', $variable, '==', $value, $quoteValue);
412 412
         
413
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
413
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
414 414
         {
415 415
             return $command;
416 416
         }
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
     {
423 423
         $command = self::_buildIfVar('ElseIf', $variable, '==', $value, true);
424 424
         
425
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
425
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
426 426
         {
427 427
             return $command;
428 428
         }
@@ -430,11 +430,11 @@  discard block
 block discarded – undo
430 430
         throw self::_exceptionUnexpectedType('ElseIfVarEqualsString', $command);
431 431
     }
432 432
     
433
-    public static function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable
433
+    public static function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable
434 434
     {
435 435
         $command = self::_buildIfVar('ElseIf', $variable, '!=', $value, $quoteValue);
436 436
         
437
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
437
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
438 438
         {
439 439
             return $command;
440 440
         }
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
     {
447 447
         $command = self::_buildIfVar('ElseIf', $variable, '!=', $value, true);
448 448
         
449
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
449
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
450 450
         {
451 451
             return $command;
452 452
         }
@@ -454,11 +454,11 @@  discard block
 block discarded – undo
454 454
         throw self::_exceptionUnexpectedType('ElseIfVarNotEqualsString', $command);
455 455
     }
456 456
     
457
-    public static function ifContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains
457
+    public static function ifContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_Contains
458 458
     {
459 459
         $command = self::_buildIfContains('If', $variable, $search, $caseInsensitive);
460 460
         
461
-        if($command instanceof Mailcode_Commands_Command_If_Contains)
461
+        if ($command instanceof Mailcode_Commands_Command_If_Contains)
462 462
         {
463 463
             return $command;
464 464
         }
@@ -466,11 +466,11 @@  discard block
 block discarded – undo
466 466
         throw self::_exceptionUnexpectedType('ElseIfContains', $command);
467 467
     }
468 468
     
469
-    public static function elseIfContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains
469
+    public static function elseIfContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains
470 470
     {
471 471
         $command = self::_buildIfContains('ElseIf', $variable, $search, $caseInsensitive);
472 472
         
473
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Contains)
473
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Contains)
474 474
         {
475 475
             return $command;
476 476
         }
@@ -478,11 +478,11 @@  discard block
 block discarded – undo
478 478
         throw self::_exceptionUnexpectedType('ElseIfContains', $command);
479 479
     }
480 480
     
481
-    protected static function _buildIfContains(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
481
+    protected static function _buildIfContains(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
482 482
     {
483 483
         $keyword = ' ';
484 484
         
485
-        if($caseInsensitive)
485
+        if ($caseInsensitive)
486 486
         {
487 487
             $keyword = ' insensitive: ';
488 488
         }
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
     
518 518
     protected static function _checkCommand(Mailcode_Commands_Command $command) : void
519 519
     {
520
-        if($command->isValid())
520
+        if ($command->isValid())
521 521
         {
522 522
             return;
523 523
         }
Please login to merge, or discard this patch.