Test Failed
Pull Request — master (#13)
by Sebastian
05:15
created
src/Mailcode/Commands/Command.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
     private int $instanceID;
134 134
 
135
-    public function __construct(string $type='', string $paramsString='', string $matchedText='')
135
+    public function __construct(string $type = '', string $paramsString = '', string $matchedText = '')
136 136
     {
137 137
         self::$instanceCounter++;
138 138
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     {
224 224
         $this->requireNonDummy();
225 225
         
226
-        if($this->hash === '') {
226
+        if ($this->hash === '') {
227 227
             $this->hash = md5($this->matchedText);
228 228
         }
229 229
         
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
      */
237 237
     protected function requireNonDummy() : void
238 238
     {
239
-        if(!$this->isDummy())
239
+        if (!$this->isDummy())
240 240
         {
241 241
             return;
242 242
         }
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     
256 256
     protected function validate() : OperationResult
257 257
     {
258
-        if(!$this->validated)
258
+        if (!$this->validated)
259 259
         {
260 260
             $this->requireNonDummy();
261 261
             $this->validateSyntax();
@@ -275,10 +275,10 @@  discard block
 block discarded – undo
275 275
     {
276 276
         $validations = $this->resolveValidations();
277 277
 
278
-        foreach($validations as $validation)
278
+        foreach ($validations as $validation)
279 279
         {
280 280
             // break off at the first validation issue
281
-            if(!$this->validateSyntaxMethod($validation))
281
+            if (!$this->validateSyntaxMethod($validation))
282 282
             {
283 283
                 return;
284 284
             }
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     {
303 303
         $method = 'validateSyntax_'.$validation;
304 304
         
305
-        if(!method_exists($this, $method))
305
+        if (!method_exists($this, $method))
306 306
         {
307 307
             throw new CommandException(
308 308
                 'Missing validation method ['.$validation.']',
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
     public function validateNesting() : OperationResult
334 334
     {
335
-        if($this->nestingValidated)
335
+        if ($this->nestingValidated)
336 336
         {
337 337
             return $this->validationResult;
338 338
         }
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     
357 357
     public function getType() : string
358 358
     {
359
-        if($this->supportsType())
359
+        if ($this->supportsType())
360 360
         {
361 361
             return $this->type;
362 362
         }
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
     
377 377
     public function getHighlighted() : string
378 378
     {
379
-        if(!$this->isValid())
379
+        if (!$this->isValid())
380 380
         {
381 381
             return '';
382 382
         }
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     
387 387
     public function getParamsString() : string
388 388
     {
389
-        if($this->requiresParameters())
389
+        if ($this->requiresParameters())
390 390
         {
391 391
             return $this->paramsString;
392 392
         }
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
      */
406 406
     public function requireParams() : Mailcode_Parser_Statement
407 407
     {
408
-        if(isset($this->params))
408
+        if (isset($this->params))
409 409
         {
410 410
             return $this->params;
411 411
         }
@@ -437,22 +437,22 @@  discard block
 block discarded – undo
437 437
      */
438 438
     final public function getCommandType() : string
439 439
     {
440
-        if($this instanceof Mailcode_Commands_Command_Type_Closing)
440
+        if ($this instanceof Mailcode_Commands_Command_Type_Closing)
441 441
         {
442 442
             return 'Closing';
443 443
         }
444 444
         
445
-        if($this instanceof Mailcode_Commands_Command_Type_Opening)
445
+        if ($this instanceof Mailcode_Commands_Command_Type_Opening)
446 446
         {
447 447
             return 'Opening';
448 448
         }
449 449
         
450
-        if($this instanceof Mailcode_Commands_Command_Type_Sibling)
450
+        if ($this instanceof Mailcode_Commands_Command_Type_Sibling)
451 451
         {
452 452
             return 'Sibling';
453 453
         }
454 454
         
455
-        if($this instanceof Mailcode_Commands_Command_Type_Standalone)
455
+        if ($this instanceof Mailcode_Commands_Command_Type_Standalone)
456 456
         {
457 457
             return 'Standalone';
458 458
         }
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
      */
494 494
     public function getLogicKeywords() : Mailcode_Commands_LogicKeywords
495 495
     {
496
-        if(isset($this->logicKeywords) && $this->supportsLogicKeywords())
496
+        if (isset($this->logicKeywords) && $this->supportsLogicKeywords())
497 497
         {
498 498
             return $this->logicKeywords;
499 499
         }
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 
524 524
     protected function getValidator() : Mailcode_Parser_Statement_Validator
525 525
     {
526
-        if(isset($this->validator))
526
+        if (isset($this->validator))
527 527
         {
528 528
             return $this->validator;
529 529
         }
Please login to merge, or discard this patch.
src/Mailcode/Interfaces/Commands/Validation/URLDecode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      * @return $this
33 33
      * @throws ParamsException
34 34
      */
35
-    public function setURLDecoding(bool $enabled=true) : self;
35
+    public function setURLDecoding(bool $enabled = true) : self;
36 36
 
37 37
     public function isURLDecoded(): bool;
38 38
 }
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/ApacheVelocity/ShowURL.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,16 +48,16 @@
 block discarded – undo
48 48
         $statements = array();
49 49
         $statements[] = $this->renderURL($urlVar);
50 50
 
51
-        if($command->isTrackingEnabled())
51
+        if ($command->isTrackingEnabled())
52 52
         {
53 53
             $statements[] = $this->renderTracking($command);
54 54
         }
55 55
 
56
-        if($command->hasQueryParams())
56
+        if ($command->hasQueryParams())
57 57
         {
58 58
             $params = $command->getQueryParams();
59 59
 
60
-            foreach($params as $name => $value)
60
+            foreach ($params as $name => $value)
61 61
             {
62 62
                 $statements[] = $this->renderQueryParam($name, $value);
63 63
             }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/URLDecode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      * @return $this
36 36
      * @throws Mailcode_Exception
37 37
      */
38
-    public function setURLDecoding(bool $enabled=true) : self
38
+    public function setURLDecoding(bool $enabled = true) : self
39 39
     {
40 40
         return $this->setEncodingEnabled(Mailcode_Commands_Keywords::TYPE_URLDECODE, $enabled);
41 41
     }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/URLEncode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
      * @return $this
42 42
      * @throws Mailcode_Exception
43 43
      */
44
-    public function setURLEncoding(bool $enabled=true) : self
44
+    public function setURLEncoding(bool $enabled = true) : self
45 45
     {
46 46
         return $this->setEncodingEnabled(Mailcode_Commands_Keywords::TYPE_URLENCODE, $enabled);
47 47
     }
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/ShowEncoded.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function getTextToken() : Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral
68 68
     {
69
-        if(isset($this->textToken))
69
+        if (isset($this->textToken))
70 70
         {
71 71
             return $this->textToken;
72 72
         }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
     public function setText(string $text) : self
87 87
     {
88
-        if(isset($this->textToken))
88
+        if (isset($this->textToken))
89 89
         {
90 90
             $this->textToken->setText($text);
91 91
             return $this;
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             ->getInfo()
105 105
             ->getStringLiterals();
106 106
 
107
-        if(empty($strings))
107
+        if (empty($strings))
108 108
         {
109 109
             $this->getValidationResult()->makeError(
110 110
                 t('No text to encode has been specified.'),
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             ->getInfo()
123 123
             ->getKeywords();
124 124
 
125
-        if(!empty($keywords))
125
+        if (!empty($keywords))
126 126
         {
127 127
             return;
128 128
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/Show/Encoded.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         $this->instantiator->checkCommand($cmd);
45 45
 
46
-        if($cmd instanceof Mailcode_Commands_Command_ShowEncoded)
46
+        if ($cmd instanceof Mailcode_Commands_Command_ShowEncoded)
47 47
         {
48 48
             return $cmd;
49 49
         }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $params = array();
62 62
         $params[] = $this->instantiator->quoteString($subject);
63 63
 
64
-        foreach($encodings as $keyword)
64
+        foreach ($encodings as $keyword)
65 65
         {
66 66
             $params[] = $this->instantiator->filterKeyword($keyword);
67 67
         }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/QueryParamsTrait.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $params = $this->collectParams();
54 54
         $result = array();
55 55
 
56
-        foreach($params as $param)
56
+        foreach ($params as $param)
57 57
         {
58 58
             $result[$param->getName()] = $param->getValue();
59 59
         }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $params = $this->collectParams();
70 70
         $result = array();
71 71
 
72
-        foreach($params as $param)
72
+        foreach ($params as $param)
73 73
         {
74 74
             $result[] = $param->getToken();
75 75
         }
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
         $result = array();
91 91
 
92
-        foreach($literals as $literal)
92
+        foreach ($literals as $literal)
93 93
         {
94 94
             $text = $literal->getText();
95 95
 
96
-            if(strpos($text, '=') !== false)
96
+            if (strpos($text, '=') !== false)
97 97
             {
98 98
                 $param = new QueryParam($literal);
99 99
                 $result[$param->getName()] = $param;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $params = $this->collectParams();
109 109
 
110
-        if(isset($params[$name]))
110
+        if (isset($params[$name]))
111 111
         {
112 112
             return $params[$name]->getValue();
113 113
         }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     {
127 127
         $params = $this->collectParams();
128 128
 
129
-        if(isset($params[$name]))
129
+        if (isset($params[$name]))
130 130
         {
131 131
             $params[$name]->setValue($value);
132 132
         }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     {
150 150
         $params = $this->collectParams();
151 151
 
152
-        if(isset($params[$name]))
152
+        if (isset($params[$name]))
153 153
         {
154 154
             $this->requireParams()
155 155
                 ->getInfo()
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/ShowNumber.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
              ->getStringLiterals();
68 68
          
69 69
          // no format specified? Use the default one.
70
-         if(empty($tokens))
70
+         if (empty($tokens))
71 71
          {
72 72
              return;
73 73
          }
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
             ->getInfo()
83 83
             ->getKeywords();
84 84
 
85
-        foreach($keywords as $keyword)
85
+        foreach ($keywords as $keyword)
86 86
         {
87
-            if($keyword->getKeyword() === Mailcode_Commands_Keywords::TYPE_ABSOLUTE)
87
+            if ($keyword->getKeyword() === Mailcode_Commands_Keywords::TYPE_ABSOLUTE)
88 88
             {
89 89
                 $this->absoluteKeyword = $keyword;
90 90
                 break;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     {
97 97
         $result = new Mailcode_Number_Info($format);
98 98
 
99
-        if($result->isValid())
99
+        if ($result->isValid())
100 100
         {
101 101
             $this->formatString = $format;
102 102
             return;
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
 
126 126
     public function setAbsolute(bool $absolute) : Mailcode_Commands_Command_ShowNumber
127 127
     {
128
-        if($absolute === false && isset($this->absoluteKeyword))
128
+        if ($absolute === false && isset($this->absoluteKeyword))
129 129
         {
130 130
             $this->requireParams()->getInfo()->removeKeyword($this->absoluteKeyword->getKeyword());
131 131
             $this->absoluteKeyword = null;
132 132
         }
133 133
 
134
-        if($absolute === true && !isset($this->absoluteKeyword))
134
+        if ($absolute === true && !isset($this->absoluteKeyword))
135 135
         {
136 136
              $this->requireParams()
137 137
                  ->getInfo()
Please login to merge, or discard this patch.