Passed
Push — master ( 5ccc42...a49720 )
by Sebastian
02:49
created
src/Mailcode/Number/Info.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $format = trim($format);
44 44
 
45
-        if(empty($format))
45
+        if (empty($format))
46 46
         {
47 47
             $format = self::DEFAULT_FORMAT;
48 48
         }
@@ -108,15 +108,15 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $format = $this->format;
110 110
 
111
-        foreach($this->validations as $validation)
111
+        foreach ($this->validations as $validation)
112 112
         {
113 113
             $method = 'parse_'.$validation;
114 114
 
115
-            if(method_exists($this, $method))
115
+            if (method_exists($this, $method))
116 116
             {
117 117
                 $format = $this->$method($format);
118 118
 
119
-                if(!$this->isValid())
119
+                if (!$this->isValid())
120 120
                 {
121 121
                     return;
122 122
                 }
@@ -138,13 +138,13 @@  discard block
 block discarded – undo
138 138
 
139 139
     private function parse_padding(string $format) : string
140 140
     {
141
-        if(strstr($format, ':') === false) {
141
+        if (strstr($format, ':') === false) {
142 142
             return $format;
143 143
         }
144 144
 
145 145
         $parts = ConvertHelper::explodeTrim(':', $this->format);
146 146
 
147
-        if(count($parts) !== 2)
147
+        if (count($parts) !== 2)
148 148
         {
149 149
             $this->makeError(
150 150
                 t(
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
         $padding = $parts[1];
161 161
 
162
-        if(!preg_match('/\A[#]+\z/x', $padding))
162
+        if (!preg_match('/\A[#]+\z/x', $padding))
163 163
         {
164 164
             $this->makeError(
165 165
                 t('The padding may only contain hashes (%1$s given).', '<code>'.$padding.'</code>'),
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
     private function parse_number(string $format) : string
178 178
     {
179
-        if($format[0] !== '1')
179
+        if ($format[0] !== '1')
180 180
         {
181 181
             $this->makeError(
182 182
                 t('The first character of the format must be a %1$s.', '<code>1</code>'),
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         $base = str_replace(array('.', ',', ' '), '', $format);
191 191
         $number = intval(substr($base, 0, 4));
192 192
 
193
-        if($number === 1000) {
193
+        if ($number === 1000) {
194 194
             return $format;
195 195
         }
196 196
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         $separator = $format[1];
211 211
 
212 212
         // No thousands separator
213
-        if($separator === '0')
213
+        if ($separator === '0')
214 214
         {
215 215
             return $format;
216 216
         }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         // Valid thousands separator
219 219
         $validSeparators = array(' ', ',', '.');
220 220
 
221
-        if(in_array($separator, $validSeparators))
221
+        if (in_array($separator, $validSeparators))
222 222
         {
223 223
             $this->thousandsSeparator = $separator;
224 224
             $format = str_replace('1'.$separator, '1', $format);
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 
255 255
     private function parse_separators(string $format) : string
256 256
     {
257
-        if(!empty($this->thousandsSeparator) && !empty($this->decimalsSeparator) && $this->thousandsSeparator === $this->decimalsSeparator)
257
+        if (!empty($this->thousandsSeparator) && !empty($this->decimalsSeparator) && $this->thousandsSeparator === $this->decimalsSeparator)
258 258
         {
259 259
             $this->makeError(
260 260
                 t(
@@ -270,14 +270,14 @@  discard block
 block discarded – undo
270 270
 
271 271
     private function parse_decimals(string $format) : string
272 272
     {
273
-        if(empty($this->decimalsSeparator))
273
+        if (empty($this->decimalsSeparator))
274 274
         {
275 275
             return $format;
276 276
         }
277 277
 
278 278
         $parts = ConvertHelper::explodeTrim($this->decimalsSeparator, $format);
279 279
 
280
-        if(!isset($parts[1]))
280
+        if (!isset($parts[1]))
281 281
         {
282 282
             $this->makeError(
283 283
                 t('Cannot determine the amount of decimals.').' '.
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
             return $format;
294 294
         }
295 295
 
296
-        if($this->validateDecimals($parts[1]))
296
+        if ($this->validateDecimals($parts[1]))
297 297
         {
298 298
             $this->decimals = strlen($parts[1]);
299 299
         }
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
     private function validateDecimals(string $decimals) : bool
305 305
     {
306
-        if(preg_match('/\A[0]+\z/x', $decimals)) {
306
+        if (preg_match('/\A[0]+\z/x', $decimals)) {
307 307
             return true;
308 308
         }
309 309
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
     {
323 323
         $validSeparators = array('.', ',');
324 324
 
325
-        if(in_array($separator, $validSeparators)) {
325
+        if (in_array($separator, $validSeparators)) {
326 326
             return true;
327 327
         }
328 328
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
      */
345 345
     private function parse_regex(string $format) : string
346 346
     {
347
-        if(preg_match('/1[ ,.]?000|1[ ,.]?000[.,][0]+/x', $format))
347
+        if (preg_match('/1[ ,.]?000|1[ ,.]?000[.,][0]+/x', $format))
348 348
         {
349 349
             return $format;
350 350
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/If.php 1 patch
Spacing   +22 added lines, -22 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
         }
@@ -134,11 +134,11 @@  discard block
 block discarded – undo
134 134
     * @param bool $caseInsensitive
135 135
     * @return Mailcode_Commands_Command_If_Contains
136 136
     */
137
-    public function ifContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains
137
+    public function ifContains(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_Contains
138 138
     {
139 139
         $command = $this->instantiator->buildIfContains('If', $variable, $searchTerms, $caseInsensitive);
140 140
         
141
-        if($command instanceof Mailcode_Commands_Command_If_Contains)
141
+        if ($command instanceof Mailcode_Commands_Command_If_Contains)
142 142
         {
143 143
             return $command;
144 144
         }
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
         throw $this->instantiator->exceptionUnexpectedType('IfContains', $command);
147 147
     }
148 148
     
149
-    public function ifBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_BeginsWith
149
+    public function ifBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_BeginsWith
150 150
     {
151 151
         $command = $this->instantiator->buildIfBeginsWith('If', $variable, $search, $caseInsensitive);
152 152
         
153
-        if($command instanceof Mailcode_Commands_Command_If_BeginsWith)
153
+        if ($command instanceof Mailcode_Commands_Command_If_BeginsWith)
154 154
         {
155 155
             return $command;
156 156
         }
@@ -158,11 +158,11 @@  discard block
 block discarded – undo
158 158
         throw $this->instantiator->exceptionUnexpectedType('IfBeginsWith', $command);
159 159
     }
160 160
     
161
-    public function ifEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_EndsWith
161
+    public function ifEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_EndsWith
162 162
     {
163 163
         $command = $this->instantiator->buildIfEndsWith('If', $variable, $search, $caseInsensitive);
164 164
         
165
-        if($command instanceof Mailcode_Commands_Command_If_EndsWith)
165
+        if ($command instanceof Mailcode_Commands_Command_If_EndsWith)
166 166
         {
167 167
             return $command;
168 168
         }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     {
175 175
         $command = $this->instantiator->buildIfBiggerThan('If', $variable, $value);
176 176
 
177
-        if($command instanceof Mailcode_Commands_Command_If_BiggerThan)
177
+        if ($command instanceof Mailcode_Commands_Command_If_BiggerThan)
178 178
         {
179 179
             return $command;
180 180
         }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     {
187 187
         $command = $this->instantiator->buildIfSmallerThan('If', $variable, $value);
188 188
 
189
-        if($command instanceof Mailcode_Commands_Command_If_SmallerThan)
189
+        if ($command instanceof Mailcode_Commands_Command_If_SmallerThan)
190 190
         {
191 191
             return $command;
192 192
         }
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     {
199 199
         $command = $this->instantiator->buildIfEquals('If', $variable, $value);
200 200
 
201
-        if($command instanceof Mailcode_Commands_Command_If_EqualsNumber)
201
+        if ($command instanceof Mailcode_Commands_Command_If_EqualsNumber)
202 202
         {
203 203
             return $command;
204 204
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/Show.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         
34 34
         $this->instantiator->checkCommand($cmd);
35 35
         
36
-        if($cmd instanceof Mailcode_Commands_Command_ShowVariable)
36
+        if ($cmd instanceof Mailcode_Commands_Command_ShowVariable)
37 37
         {
38 38
             return $cmd;
39 39
         }
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
         throw $this->instantiator->exceptionUnexpectedType('ShowVariable', $cmd);
42 42
     }
43 43
     
44
-    public function showDate(string $variableName, string $formatString="") : Mailcode_Commands_Command_ShowDate
44
+    public function showDate(string $variableName, string $formatString = "") : Mailcode_Commands_Command_ShowDate
45 45
     {
46 46
         $variableName = $this->instantiator->filterVariableName($variableName);
47 47
         
48 48
         $format = '';
49
-        if(!empty($formatString))
49
+        if (!empty($formatString))
50 50
         {
51 51
             $format = sprintf(
52 52
                 ' "%s"',
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         
68 68
         $this->instantiator->checkCommand($cmd);
69 69
         
70
-        if($cmd instanceof Mailcode_Commands_Command_ShowDate)
70
+        if ($cmd instanceof Mailcode_Commands_Command_ShowDate)
71 71
         {
72 72
             return $cmd;
73 73
         }
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
         throw $this->instantiator->exceptionUnexpectedType('ShowDate', $cmd);
76 76
     }
77 77
 
78
-    public function showNumber(string $variableName, string $formatString="") : Mailcode_Commands_Command_ShowNumber
78
+    public function showNumber(string $variableName, string $formatString = "") : Mailcode_Commands_Command_ShowNumber
79 79
     {
80 80
         $variableName = $this->instantiator->filterVariableName($variableName);
81 81
 
82 82
         $format = '';
83
-        if(!empty($formatString))
83
+        if (!empty($formatString))
84 84
         {
85 85
             $format = sprintf(
86 86
                 ' "%s"',
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
         $this->instantiator->checkCommand($cmd);
103 103
 
104
-        if($cmd instanceof Mailcode_Commands_Command_ShowNumber)
104
+        if ($cmd instanceof Mailcode_Commands_Command_ShowNumber)
105 105
         {
106 106
             return $cmd;
107 107
         }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         
123 123
         $this->instantiator->checkCommand($cmd);
124 124
         
125
-        if($cmd instanceof Mailcode_Commands_Command_ShowSnippet)
125
+        if ($cmd instanceof Mailcode_Commands_Command_ShowSnippet)
126 126
         {
127 127
             return $cmd;
128 128
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/ElseIf.php 1 patch
Spacing   +22 added lines, -22 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
         }
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
     * @param bool $caseInsensitive
111 111
     * @return Mailcode_Commands_Command_ElseIf_Contains
112 112
     */
113
-    public function elseIfContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains
113
+    public function elseIfContains(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains
114 114
     {
115 115
         $command = $this->instantiator->buildIfContains('ElseIf', $variable, $searchTerms, $caseInsensitive);
116 116
         
117
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Contains)
117
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Contains)
118 118
         {
119 119
             return $command;
120 120
         }
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
         throw $this->instantiator->exceptionUnexpectedType('ElseIfContains', $command);
123 123
     }
124 124
     
125
-    public function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_BeginsWith
125
+    public function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_BeginsWith
126 126
     {
127 127
         $command = $this->instantiator->buildIfBeginsWith('ElseIf', $variable, $search, $caseInsensitive);
128 128
         
129
-        if($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith)
129
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith)
130 130
         {
131 131
             return $command;
132 132
         }
@@ -134,11 +134,11 @@  discard block
 block discarded – undo
134 134
         throw $this->instantiator->exceptionUnexpectedType('ElseIfBeginsWith', $command);
135 135
     }
136 136
     
137
-    public function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_EndsWith
137
+    public function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_EndsWith
138 138
     {
139 139
         $command = $this->instantiator->buildIfEndsWith('ElseIf', $variable, $search, $caseInsensitive);
140 140
         
141
-        if($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith)
141
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith)
142 142
         {
143 143
             return $command;
144 144
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     {
151 151
         $command = $this->instantiator->buildIfEmpty('ElseIf', $variable);
152 152
         
153
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Empty)
153
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Empty)
154 154
         {
155 155
             return $command;
156 156
         }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     {
163 163
         $command = $this->instantiator->buildIfNotEmpty('ElseIf', $variable);
164 164
         
165
-        if($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty)
165
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty)
166 166
         {
167 167
             return $command;
168 168
         }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     {
175 175
         $command = $this->instantiator->buildIfBiggerThan('ElseIf', $variable, $value);
176 176
 
177
-        if($command instanceof Mailcode_Commands_Command_ElseIf_BiggerThan)
177
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_BiggerThan)
178 178
         {
179 179
             return $command;
180 180
         }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     {
187 187
         $command = $this->instantiator->buildIfSmallerThan('ElseIf', $variable, $value);
188 188
 
189
-        if($command instanceof Mailcode_Commands_Command_ElseIf_SmallerThan)
189
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_SmallerThan)
190 190
         {
191 191
             return $command;
192 192
         }
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     {
199 199
         $command = $this->instantiator->buildIfEquals('ElseIf', $variable, $value);
200 200
 
201
-        if($command instanceof Mailcode_Commands_Command_ElseIf_EqualsNumber)
201
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_EqualsNumber)
202 202
         {
203 203
             return $command;
204 204
         }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/IfNumber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     {
51 51
         $value = $this->getRawNumber();
52 52
 
53
-        if(!is_numeric($value))
53
+        if (!is_numeric($value))
54 54
         {
55 55
             $this->validationResult->makeError(
56 56
                 t(
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             $command->getID()
65 65
         );
66 66
         
67
-        if(!class_exists($class))
67
+        if (!class_exists($class))
68 68
         {
69 69
             throw new Mailcode_Translator_Exception(
70 70
                 sprintf('Unknown command %s in translator', $command->getID()),
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     {
93 93
         $subject = $safeguard->makeSafe();
94 94
         
95
-        if(!$safeguard->hasPlaceholders())
95
+        if (!$safeguard->hasPlaceholders())
96 96
         {
97 97
             return $subject;
98 98
         }
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
         
102 102
         $replaces = array();
103 103
         
104
-        foreach($placeholders as $placeholder)
104
+        foreach ($placeholders as $placeholder)
105 105
         {
106 106
             $command = $placeholder->getCommand();
107 107
 
108 108
             $replaces[$placeholder->getReplacementText()] = $this->translateCommand($command);
109 109
 
110
-            if($command instanceof Mailcode_Interfaces_Commands_ProtectedContent)
110
+            if ($command instanceof Mailcode_Interfaces_Commands_ProtectedContent)
111 111
             {
112 112
                 $replaces[$command->getContentPlaceholder()] = $command->getContent();
113 113
             }
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/ApacheVelocity/ShowVariable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         $varName = ltrim($command->getVariableName(), '$');
26 26
 
27 27
         // Automatically URL escape the variable if it's in an URL.
28
-        if($command->isURLEncoded())
28
+        if ($command->isURLEncoded())
29 29
         {
30 30
             return sprintf(
31 31
                 '${esc.url($%s)}',
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             );
34 34
         }
35 35
 
36
-        if($command->isURLDecoded())
36
+        if ($command->isURLDecoded())
37 37
         {
38 38
             return sprintf(
39 39
                 '${esc.unurl($%s)}',
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/ApacheVelocity/Base/AbstractIf.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         // IF type.
40 40
         $method = 'translate'.$this->getIfType($command);
41 41
 
42
-        if(method_exists($this, $method))
42
+        if (method_exists($this, $method))
43 43
         {
44 44
             return strval($this->$method($command));
45 45
         }
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
         
54 54
         $keywords = $command->getLogicKeywords()->getKeywords();
55 55
         
56
-        foreach($keywords as $keyword)
56
+        foreach ($keywords as $keyword)
57 57
         {
58 58
             $keyCommand = $keyword->getCommand();
59 59
             
60
-            if($keyCommand instanceof Mailcode_Commands_IfBase)
60
+            if ($keyCommand instanceof Mailcode_Commands_IfBase)
61 61
             {
62 62
                 $body .= ' '.$this->getSign($keyword).' '.$this->translateBody($keyCommand);
63 63
             }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     
81 81
     protected function getSign(Mailcode_Commands_LogicKeywords_Keyword $keyword) : string
82 82
     {
83
-        switch($keyword->getName())
83
+        switch ($keyword->getName())
84 84
         {
85 85
             case 'and':
86 86
                 return '&&';
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     {
118 118
         $sign = '';
119 119
         
120
-        if($notEmpty)
120
+        if ($notEmpty)
121 121
         {
122 122
             $sign = '!';
123 123
         }
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
     {
134 134
         $params = $command->getParams();
135 135
 
136
-        if(!$params)
136
+        if (!$params)
137 137
         {
138 138
             return '';
139 139
         }
140 140
 
141
-        if($command->hasFreeformParameters())
141
+        if ($command->hasFreeformParameters())
142 142
         {
143 143
             return $params->getStatementString();
144 144
         }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $test = strtolower(trim($value, '"'));
152 152
         $fullName = $variable->getFullName();
153 153
 
154
-        if(in_array($test, array('true', 'false')))
154
+        if (in_array($test, array('true', 'false')))
155 155
         {
156 156
             $fullName .= '.toLowerCase()';
157 157
             $value = '"'.$test.'"';
@@ -178,12 +178,12 @@  discard block
 block discarded – undo
178 178
         $varName = $variable->getFullName();
179 179
 
180 180
         $opts = 's';
181
-        if($caseSensitive)
181
+        if ($caseSensitive)
182 182
         {
183 183
             $opts = 'is';
184 184
         }
185 185
         
186
-        foreach($searchTerms as $token)
186
+        foreach ($searchTerms as $token)
187 187
         {
188 188
             $parts[] = sprintf(
189 189
                 '%s.matches("(?%s)%s")',
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     protected function _translateSearch(string $mode, Mailcode_Variables_Variable $variable, bool $caseSensitive, string $searchTerm) : string
200 200
     {
201 201
         $method = $mode.'With';
202
-        if($caseSensitive)
202
+        if ($caseSensitive)
203 203
         {
204 204
             $method = $mode.'WithIgnoreCase';
205 205
         }
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/ApacheVelocity/ShowSnippet.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             $varName
35 35
         );
36 36
 
37
-        if($command->isURLEncoded())
37
+        if ($command->isURLEncoded())
38 38
         {
39 39
             return sprintf(
40 40
                 '${esc.url($%s)}',
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             );
43 43
         }
44 44
 
45
-        if($command->isURLDecoded())
45
+        if ($command->isURLDecoded())
46 46
         {
47 47
             return sprintf(
48 48
                 '${esc.unurl($%s)}',
Please login to merge, or discard this patch.