Passed
Push — master ( 62420e...b1849d )
by Sebastian
03:41
created
src/Mailcode/Commands/Command/ShowVariable.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $tokens = $this->requireParams()->getInfo()->getTokens();
59 59
         $allowed = $this->resolveActiveTokens();
60 60
 
61
-        if(count($tokens) > count($allowed))
61
+        if (count($tokens) > count($allowed))
62 62
         {
63 63
             $this->validationResult->makeError(
64 64
                 t('Unknown parameters found:').' '.
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 
82 82
         $encodings = $this->getSupportedEncodings();
83 83
 
84
-        foreach($encodings as $keyword)
84
+        foreach ($encodings as $keyword)
85 85
         {
86 86
             $token = $this->getEncodingToken($keyword);
87
-            if($token)
87
+            if ($token)
88 88
             {
89 89
                 $allowed[] = $token;
90 90
             }
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Tokenizer/EventHandler.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
     private function addListener(string $eventName, callable $listener) : void
154 154
     {
155
-        if(!isset($this->listeners[$eventName]))
155
+        if (!isset($this->listeners[$eventName]))
156 156
         {
157 157
             $this->listeners[$eventName] = array();
158 158
         }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     {
197 197
         $this->triggerEvent(self::EVENT_TOKEN_REMOVED, $token);
198 198
 
199
-        if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
199
+        if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
200 200
         {
201 201
             $this->triggerKeywordRemoved($token->getKeyword());
202 202
         }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     {
223 223
         $this->triggerEvent(self::EVENT_TOKEN_ADDED, $token);
224 224
 
225
-        if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
225
+        if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
226 226
         {
227 227
             $this->triggerKeywordAdded($token->getKeyword());
228 228
         }
@@ -261,12 +261,12 @@  discard block
 block discarded – undo
261 261
      */
262 262
     private function triggerEvent(string $eventName, ...$listenerArgs) : void
263 263
     {
264
-        if(!isset($this->listeners[$eventName]))
264
+        if (!isset($this->listeners[$eventName]))
265 265
         {
266 266
             return;
267 267
         }
268 268
 
269
-        foreach($this->listeners[$eventName] as $listener)
269
+        foreach ($this->listeners[$eventName] as $listener)
270 270
         {
271 271
             $listener($this->tokenizer, ...$listenerArgs);
272 272
         }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/TrackingIDTrait.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $token = $this->getTrackingIDToken();
47 47
 
48
-        if($token === null)
48
+        if ($token === null)
49 49
         {
50 50
             return '';
51 51
         }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
     private function filterTrackingID(string $trackingID) : string
60 60
     {
61
-        if(empty($trackingID))
61
+        if (empty($trackingID))
62 62
         {
63 63
             return AutoTrackingID::generate($this);
64 64
         }
@@ -75,19 +75,19 @@  discard block
 block discarded – undo
75 75
 
76 76
     private function initTrackingToken() : void
77 77
     {
78
-        if(!$this->isTrackingEnabled())
78
+        if (!$this->isTrackingEnabled())
79 79
         {
80 80
             $this->clearTrackingIDToken();
81 81
             return;
82 82
         }
83 83
 
84
-        if(isset($this->trackingIDToken))
84
+        if (isset($this->trackingIDToken))
85 85
         {
86 86
             return;
87 87
         }
88 88
 
89 89
         $token = $this->detectToken();
90
-        if($token === null)
90
+        if ($token === null)
91 91
         {
92 92
             $token = $this->requireParams()
93 93
                 ->getInfo()
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $this->trackingIDToken = null;
103 103
 
104 104
         $token = $this->detectToken();
105
-        if($token !== null)
105
+        if ($token !== null)
106 106
         {
107 107
             $this->requireParams()
108 108
                 ->getInfo()
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $token = $this->getTrackingIDToken();
116 116
 
117
-        if($token !== null)
117
+        if ($token !== null)
118 118
         {
119 119
             $token->setText($this->filterTrackingID($trackingID));
120 120
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             ->getInfo()
129 129
             ->getStringLiterals();
130 130
 
131
-        if(empty($literals))
131
+        if (empty($literals))
132 132
         {
133 133
             return null;
134 134
         }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 
138 138
         $id = $trackingID->getText();
139 139
 
140
-        if(strpos($id, '=') === false)
140
+        if (strpos($id, '=') === false)
141 141
         {
142 142
             return $trackingID;
143 143
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/Show.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
             'ShowVariable',
36 36
             '',
37 37
             $variableName,
38
-            '{showvar:' . $variableName . '}'
38
+            '{showvar:'.$variableName.'}'
39 39
         );
40 40
 
41 41
         $this->instantiator->checkCommand($cmd);
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/Show/Date.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         $cmd = $this->commands->createCommand(
52 52
             'ShowDate',
53 53
             '',
54
-            $variableName . $format . $timezone,
54
+            $variableName.$format.$timezone,
55 55
             sprintf(
56 56
                 '{showdate: %s%s%s}',
57 57
                 $variableName,
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             return $string;
76 76
         }
77 77
 
78
-        return '"' . str_replace('"', '\"', $string) . '"';
78
+        return '"'.str_replace('"', '\"', $string).'"';
79 79
     }
80 80
 
81 81
 }
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/For.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
         if (!$this->loopVar || !$this->keyword || !$this->sourceVar) {
148 148
             $this->validationResult->makeError(
149
-                t('Not a valid for loop.') . ' ' . t('Is the %1$s keyword missing?', 'in:'),
149
+                t('Not a valid for loop.').' '.t('Is the %1$s keyword missing?', 'in:'),
150 150
                 self::VALIDATION_INVALID_FOR_STATEMENT
151 151
             );
152 152
 
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
         }
192 192
 
193 193
         $this->validationResult->makeError(
194
-            t('The source variable is not a list variable:') . ' ' .
195
-            t('Expected a variable without dot, like %1$s.', '<code>$' . t('LIST') . '</code>'),
194
+            t('The source variable is not a list variable:').' '.
195
+            t('Expected a variable without dot, like %1$s.', '<code>$'.t('LIST').'</code>'),
196 196
             self::VALIDATION_VARIABLE_NAME_WITH_DOT
197 197
         );
198 198
     }
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/SetVariable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         // allowed ones.
125 125
         if (!in_array($sign, $allowed)) {
126 126
             $this->validationResult->makeError(
127
-                t('The %1$s sign is not allowed in this command.', '<code>' . $sign . '</code>'),
127
+                t('The %1$s sign is not allowed in this command.', '<code>'.$sign.'</code>'),
128 128
                 Mailcode_Commands_CommonConstants::VALIDATION_INVALID_OPERAND
129 129
             );
130 130
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
         throw new Mailcode_Exception(
152 152
             'No variable found.',
153
-            'Statement does not start with a variable: [' . $this->paramsString . ']',
153
+            'Statement does not start with a variable: ['.$this->paramsString.']',
154 154
             Mailcode_Commands_CommonConstants::ERROR_NO_VARIABLE_AVAILABLE
155 155
         );
156 156
     }
Please login to merge, or discard this patch.
src/Mailcode/Exception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 {
23 23
     public function __construct(string $message, ?string $details = null, $code = null, $previous = null)
24 24
     {
25
-        if(defined('TESTS_ROOT') && !empty($details)) {
25
+        if (defined('TESTS_ROOT') && !empty($details)) {
26 26
             $message .= PHP_EOL.
27 27
                 'Details:'.PHP_EOL.
28 28
                 $details;
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Tokenizer/Process/Variables.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
         $vars = Mailcode::create()->findVariables($this->tokenized, $this->tokenizer->getSourceCommand())->getGroupedByHash();
12 12
 
13 13
         $names = array();
14
-        foreach($vars as $var)
14
+        foreach ($vars as $var)
15 15
         {
16 16
             $names[$var->getMatchedText()] = $var;
17 17
         }
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
             return strlen($b) - strlen($a);
24 24
         });
25 25
 
26
-        foreach($names as $name => $var)
26
+        foreach ($names as $name => $var)
27 27
         {
28 28
             $this->registerToken('Variable', $name, $var);
29 29
         }
Please login to merge, or discard this patch.