Test Failed
Push — master ( 9ff364...742ef2 )
by Sebastian
03:58
created
src/Mailcode/Interfaces/Commands/Validation/NoHTML.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public const VALIDATION_NAME_NOHTML = 'nohtml';
10 10
 
11
-    public function setHTMLEnabled(bool $enabled=true) : self;
11
+    public function setHTMLEnabled(bool $enabled = true) : self;
12 12
 
13 13
     public function isHTMLEnabled() : bool;
14 14
 
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/ShowURL/AutoTrackingID.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     {
49 49
         $instanceID = $command->getInstanceID();
50 50
 
51
-        if(isset(self::$generated[$instanceID]))
51
+        if (isset(self::$generated[$instanceID]))
52 52
         {
53 53
             return self::$generated[$instanceID];
54 54
         }
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
 
86 86
     private static function generateIDString(TrackingIDInterface $command) : string
87 87
     {
88
-        if(isset(self::$customGenerator))
88
+        if (isset(self::$customGenerator))
89 89
         {
90 90
             $result = call_user_func(self::$customGenerator, $command);
91 91
 
92
-            if(is_string($result))
92
+            if (is_string($result))
93 93
             {
94 94
                 return $result;
95 95
             }
Please login to merge, or discard this patch.
src/Mailcode/Parser/PreParser.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public static function getContent(int $id) : string
118 118
     {
119
-        if(isset(self::$contents[$id]))
119
+        if (isset(self::$contents[$id]))
120 120
         {
121 121
             return self::$contents[$id];
122 122
         }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     public static function clearContent(int $id) : void
141 141
     {
142
-        if(isset(self::$contents[$id]))
142
+        if (isset(self::$contents[$id]))
143 143
         {
144 144
             unset(self::$contents[$id]);
145 145
         }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function parse() : self
158 158
     {
159
-        if($this->parsed)
159
+        if ($this->parsed)
160 160
         {
161 161
             return $this;
162 162
         }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
         $this->detectCommands();
168 168
 
169
-        foreach($this->commands as $commandDef)
169
+        foreach ($this->commands as $commandDef)
170 170
         {
171 171
             $this->processCommand($commandDef);
172 172
         }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         $commands = Mailcode::create()->getCommands()->getContentCommands();
188 188
         $result = array();
189 189
 
190
-        foreach($commands as $command)
190
+        foreach ($commands as $command)
191 191
         {
192 192
             $result[] = $command->getName();
193 193
         }
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
 
261 261
     private function validateCommandContents() : void
262 262
     {
263
-        foreach($this->commands as $command)
263
+        foreach ($this->commands as $command)
264 264
         {
265
-            if(!$command->validateContent($this, $this->collection))
265
+            if (!$command->validateContent($this, $this->collection))
266 266
             {
267 267
                 return;
268 268
             }
@@ -274,12 +274,12 @@  discard block
 block discarded – undo
274 274
         $openingCommands = $this->detectOpeningCommands();
275 275
         $closingCommands = $this->detectClosingCommands();
276 276
 
277
-        if(!$this->validateCommandsList($openingCommands, $closingCommands))
277
+        if (!$this->validateCommandsList($openingCommands, $closingCommands))
278 278
         {
279 279
             return;
280 280
         }
281 281
 
282
-        foreach($openingCommands as $idx => $def)
282
+        foreach ($openingCommands as $idx => $def)
283 283
         {
284 284
             $this->commands[] = new CommandDef(
285 285
                 $def['name'],
@@ -300,20 +300,20 @@  discard block
 block discarded – undo
300 300
         $opening = count($openingCommands);
301 301
         $closing = count($closingCommands);
302 302
         $max = $opening;
303
-        if($closing > $max) {
303
+        if ($closing > $max) {
304 304
             $max = $closing;
305 305
         }
306 306
 
307
-        for($i=0; $i < $max; $i++)
307
+        for ($i = 0; $i < $max; $i++)
308 308
         {
309 309
             // command closed that was never opened
310
-            if(!isset($openingCommands[$i]))
310
+            if (!isset($openingCommands[$i]))
311 311
             {
312 312
                 return $this->addErrorClosedNeverOpened($closingCommands[$i]['matchedText']);
313 313
             }
314 314
 
315 315
             // command opened that was never closed
316
-            if(!isset($closingCommands[$i]))
316
+            if (!isset($closingCommands[$i]))
317 317
             {
318 318
                 return $this->addErrorNeverClosed(
319 319
                     $openingCommands[$i]['matchedText'],
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
             }
323 323
 
324 324
             // command closed does not match opening
325
-            if($openingCommands[$i]['name'] !== $closingCommands[$i]['name'])
325
+            if ($openingCommands[$i]['name'] !== $closingCommands[$i]['name'])
326 326
             {
327 327
                 return $this->addErrorClosingMismatch(
328 328
                     $openingCommands[$i]['name'],
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 
378 378
         $result = array();
379 379
 
380
-        foreach($matches[0] as $idx => $matchedText)
380
+        foreach ($matches[0] as $idx => $matchedText)
381 381
         {
382 382
             $result[] = array(
383 383
                 'name' => strtolower(trim((string)$matches[1][$idx])),
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
             $matchedText,
462 462
             t(
463 463
                 'The command is never closed with a matching %1$s command.',
464
-                sb()->code('{' . $name . '}')
464
+                sb()->code('{'.$name.'}')
465 465
             ),
466 466
             Mailcode_Commands_CommonConstants::VALIDATION_MISSING_CONTENT_CLOSING_TAG
467 467
         );
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
                 )
486 486
                 ->t(
487 487
                     'It must be closed with a matching %1$s command.',
488
-                    sb()->code('{' . $name . '}')
488
+                    sb()->code('{'.$name.'}')
489 489
                 ),
490 490
             Mailcode_Commands_CommonConstants::VALIDATION_CONTENT_CLOSING_MISMATCHED_TAG
491 491
         );
Please login to merge, or discard this patch.
src/Mailcode/Parser/PreParser/Debugger.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -30,22 +30,22 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function debugOpeningCommands(array $matches) : void
32 32
     {
33
-        if(!Mailcode::isDebugEnabled())
33
+        if (!Mailcode::isDebugEnabled())
34 34
         {
35 35
             return;
36 36
         }
37 37
 
38 38
         Mailcode::debug('Opening command matches:');
39 39
 
40
-        if(empty($matches))
40
+        if (empty($matches))
41 41
         {
42 42
             Mailcode::debug('...None found.');
43 43
             return;
44 44
         }
45 45
 
46
-        foreach($matches[0] as $idx => $matchedText)
46
+        foreach ($matches[0] as $idx => $matchedText)
47 47
         {
48
-            $number = $idx+1;
48
+            $number = $idx + 1;
49 49
 
50 50
             Mailcode::debug(sprintf('...#%02d matched: [%s]', $number, $matchedText));
51 51
             Mailcode::debug(sprintf('...#%02d name...: [%s]', $number, $matches[1][$idx]));
@@ -59,22 +59,22 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function debugClosingCommands(array $commands) : void
61 61
     {
62
-        if(!Mailcode::isDebugEnabled())
62
+        if (!Mailcode::isDebugEnabled())
63 63
         {
64 64
             return;
65 65
         }
66 66
 
67 67
         Mailcode::debug('Closing command matches:', $commands);
68 68
 
69
-        if(empty($commands))
69
+        if (empty($commands))
70 70
         {
71 71
             Mailcode::debug('...None found.');
72 72
             return;
73 73
         }
74 74
 
75
-        foreach($commands as $idx => $command)
75
+        foreach ($commands as $idx => $command)
76 76
         {
77
-            $number = $idx+1;
77
+            $number = $idx + 1;
78 78
 
79 79
             Mailcode::debug(sprintf('...#%02d matched: [%s]', $number, $command['matchedText']));
80 80
             Mailcode::debug(sprintf('...#%02d name...: [%s]', $number, $command['name']));
@@ -83,14 +83,14 @@  discard block
 block discarded – undo
83 83
 
84 84
     public function debugCommandDef(CommandDef $commandDef) : void
85 85
     {
86
-        if(!Mailcode::isDebugEnabled())
86
+        if (!Mailcode::isDebugEnabled())
87 87
         {
88 88
             return;
89 89
         }
90 90
 
91 91
         Mailcode::debug('Command definition:', $commandDef->toArray());
92 92
 
93
-        if(defined('TESTS_ROOT'))
93
+        if (defined('TESTS_ROOT'))
94 94
         {
95 95
             print_r($commandDef->toArray());
96 96
         }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/TrackingIDTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             ->getInfo()
62 62
             ->getStringLiterals();
63 63
 
64
-        if(empty($literals))
64
+        if (empty($literals))
65 65
         {
66 66
             return;
67 67
         }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
         $id = $trackingID->getText();
72 72
 
73
-        if(strpos($id, '=') === false)
73
+        if (strpos($id, '=') === false)
74 74
         {
75 75
             $this->trackingID = $id;
76 76
             $this->trackingIDToken = $trackingID;
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/NoTrackingTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
         $this->noTrackingToken = null;
56 56
         $this->trackingEnabled = true;
57 57
 
58
-        foreach($keywords as $keyword)
58
+        foreach ($keywords as $keyword)
59 59
         {
60
-            if($keyword->getKeyword() === Mailcode_Commands_Keywords::TYPE_NO_TRACKING)
60
+            if ($keyword->getKeyword() === Mailcode_Commands_Keywords::TYPE_NO_TRACKING)
61 61
             {
62 62
                 $this->noTrackingToken = $keyword;
63 63
                 $this->trackingEnabled = false;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
     public function getNoTrackingToken() : ?Mailcode_Parser_Statement_Tokenizer_Token_Keyword
91 91
     {
92
-        if($this->noTrackingToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
92
+        if ($this->noTrackingToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
93 93
         {
94 94
             return $this->noTrackingToken;
95 95
         }
Please login to merge, or discard this patch.
src/Mailcode/Parser/Match.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -23,24 +23,24 @@
 block discarded – undo
23 23
  */
24 24
 class Mailcode_Parser_Match
25 25
 {
26
-   /**
27
-    * @var string
28
-    */
26
+    /**
27
+     * @var string
28
+     */
29 29
     protected string $name;
30 30
     
31
-   /**
32
-    * @var string
33
-    */
31
+    /**
32
+     * @var string
33
+     */
34 34
     protected string $type;
35 35
     
36
-   /**
37
-    * @var string
38
-    */
36
+    /**
37
+     * @var string
38
+     */
39 39
     protected string $params;
40 40
     
41
-   /**
42
-    * @var string
43
-    */
41
+    /**
42
+     * @var string
43
+     */
44 44
     protected string $matchedString;
45 45
     
46 46
     public function __construct(string $name, string $type, string $params, string $matchedString)
Please login to merge, or discard this patch.
src/Mailcode/Parser/Safeguard/URLAnalyzer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,24 +58,24 @@  discard block
 block discarded – undo
58 58
     private function analyzeURL(string $url) : void
59 59
     {
60 60
         // Ignore phone URLs
61
-        if(stripos($url, 'tel:') !== false)
61
+        if (stripos($url, 'tel:') !== false)
62 62
         {
63 63
             return;
64 64
         }
65 65
 
66 66
         $placeholders = $this->safeguard->getPlaceholdersCollection()->getAll();
67 67
 
68
-        foreach($placeholders as $placeholder)
68
+        foreach ($placeholders as $placeholder)
69 69
         {
70 70
             $command = $placeholder->getCommand();
71 71
 
72 72
             // The URL is not found in the replacement text
73
-            if(strpos($url, $placeholder->getReplacementText()) === false)
73
+            if (strpos($url, $placeholder->getReplacementText()) === false)
74 74
             {
75 75
                 continue;
76 76
             }
77 77
 
78
-            if($command instanceof URLEncodingInterface)
78
+            if ($command instanceof URLEncodingInterface)
79 79
             {
80 80
                 $this->applyEncoding($command);
81 81
             }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
     private function applyEncoding(URLEncodingInterface $command) : void
86 86
     {
87
-        if(!$command->isURLDecoded())
87
+        if (!$command->isURLDecoded())
88 88
         {
89 89
             $command->setURLEncoding();
90 90
         }
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Tokenizer/SpecialChars.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
     {
102 102
         $replaces = array();
103 103
 
104
-        foreach(self::$charsEncoded as $char => $placeholder)
104
+        foreach (self::$charsEncoded as $char => $placeholder)
105 105
         {
106 106
             $escaped = self::$charsEscaped[$char];
107 107
 
Please login to merge, or discard this patch.