Passed
Push — master ( 75ee28...758f58 )
by Sebastian
04:00
created
src/Mailcode/Commands/Command/ShowVariable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,12 +47,12 @@
 block discarded – undo
47 47
 
48 48
         $count = 1;
49 49
 
50
-        if(isset($this->urlencodeToken))
50
+        if (isset($this->urlencodeToken))
51 51
         {
52 52
             $count = 2;
53 53
         }
54 54
 
55
-        if(count($tokens) > $count)
55
+        if (count($tokens) > $count)
56 56
         {
57 57
             $this->validationResult->makeError(
58 58
                 t('Unknown parameters found:').' '.
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/ShowDate.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
22 22
 {
23 23
     const VALIDATION_NOT_A_FORMAT_STRING = 55401;
24 24
     
25
-   /**
26
-    * The date format string.
27
-    * @var string
28
-    */
25
+    /**
26
+     * The date format string.
27
+     * @var string
28
+     */
29 29
     private $formatString;
30 30
     
31
-   /**
32
-    * @var Mailcode_Date_FormatInfo
33
-    */
31
+    /**
32
+     * @var Mailcode_Date_FormatInfo
33
+     */
34 34
     private $formatInfo;
35 35
 
36 36
     public function getName() : string
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
         );
91 91
     }
92 92
     
93
-   /**
94
-    * Retrieves the format string used to format the date.
95
-    * 
96
-    * @return string A PHP compatible date format string.
97
-    */
93
+    /**
94
+     * Retrieves the format string used to format the date.
95
+     * 
96
+     * @return string A PHP compatible date format string.
97
+     */
98 98
     public function getFormatString() : string
99 99
     {
100 100
         return $this->formatString;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $tokens = $this->params->getInfo()->getStringLiterals();
66 66
 
67 67
         // no format specified? Use the default one.
68
-        if(empty($tokens))
68
+        if (empty($tokens))
69 69
         {
70 70
             return;
71 71
         }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $result = $this->formatInfo->validateFormat($format);
80 80
 
81
-        if($result->isValid())
81
+        if ($result->isValid())
82 82
         {
83 83
             $this->formatString = $format;
84 84
             return;
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/ShowNumber.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
     const VALIDATION_INVALID_DECIMAL_SEPARATOR = 72209;
32 32
     const VALIDATION_SEPARATORS_SAME_CHARACTER = 72210;
33 33
     
34
-   /**
35
-    * The default number format string.
36
-    * @var string
37
-    */
34
+    /**
35
+     * The default number format string.
36
+     * @var string
37
+     */
38 38
     private $formatString = Mailcode_Number_Info::DEFAULT_FORMAT;
39 39
     
40
-   /**
41
-    * @var Mailcode_Date_FormatInfo
42
-    */
40
+    /**
41
+     * @var Mailcode_Date_FormatInfo
42
+     */
43 43
     private $formatInfo;
44 44
 
45 45
     public function getName() : string
@@ -63,16 +63,16 @@  discard block
 block discarded – undo
63 63
 
64 64
     protected function validateSyntax_check_format() : void
65 65
     {
66
-         $tokens = $this->params->getInfo()->getStringLiterals();
66
+            $tokens = $this->params->getInfo()->getStringLiterals();
67 67
          
68
-         // no format specified? Use the default one.
69
-         if(empty($tokens))
70
-         {
71
-             return;
72
-         }
68
+            // no format specified? Use the default one.
69
+            if(empty($tokens))
70
+            {
71
+                return;
72
+            }
73 73
 
74
-         $token = array_pop($tokens);
75
-         $this->parseFormatString($token->getText());
74
+            $token = array_pop($tokens);
75
+            $this->parseFormatString($token->getText());
76 76
     }
77 77
 
78 78
     private function parseFormatString(string $format) : void
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
         );
92 92
     }
93 93
     
94
-   /**
95
-    * Retrieves the format string used to format the number.
96
-    * 
97
-    * @return string
98
-    */
94
+    /**
95
+     * Retrieves the format string used to format the number.
96
+     * 
97
+     * @return string
98
+     */
99 99
     public function getFormatString() : string
100 100
     {
101 101
         return $this->formatString;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
          $tokens = $this->params->getInfo()->getStringLiterals();
67 67
          
68 68
          // no format specified? Use the default one.
69
-         if(empty($tokens))
69
+         if (empty($tokens))
70 70
          {
71 71
              return;
72 72
          }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         $result = new Mailcode_Number_Info($format);
81 81
 
82
-        if($result->isValid())
82
+        if ($result->isValid())
83 83
         {
84 84
             $this->formatString = $format;
85 85
             return;
Please login to merge, or discard this patch.
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/Factory/Instantiator.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
  */
21 21
 class Mailcode_Factory_Instantiator
22 22
 {
23
-    public function buildIf(string $ifType, string $params, string $type='') : Mailcode_Commands_IfBase
23
+    public function buildIf(string $ifType, string $params, string $type = '') : Mailcode_Commands_IfBase
24 24
     {
25 25
         $stringType = $type;
26 26
         
27
-        if(!empty($type))
27
+        if (!empty($type))
28 28
         {
29 29
             $stringType = ' '.$type;
30 30
         }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         
44 44
         $this->checkCommand($command);
45 45
         
46
-        if($command instanceof Mailcode_Commands_IfBase)
46
+        if ($command instanceof Mailcode_Commands_IfBase)
47 47
         {
48 48
             return $command;
49 49
         }
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
         throw $this->exceptionUnexpectedType('IfBase', $command);
52 52
     }
53 53
     
54
-    public function buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_IfBase
54
+    public function buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_IfBase
55 55
     {
56
-        if($quoteValue)
56
+        if ($quoteValue)
57 57
         {
58 58
             $value = $this->quoteString($value);
59 59
         }
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
     * @param bool $caseInsensitive
86 86
     * @return Mailcode_Commands_IfBase
87 87
     */
88
-    public function buildIfContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
88
+    public function buildIfContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
89 89
     {
90 90
         $keyword = ' ';
91 91
         
92
-        if($caseInsensitive)
92
+        if ($caseInsensitive)
93 93
         {
94 94
             $keyword = ' insensitive: ';
95 95
         }
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
         return $this->buildIf($ifType, $condition, 'contains');
105 105
     }
106 106
     
107
-    public function buildIfBeginsWith(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
107
+    public function buildIfBeginsWith(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
108 108
     {
109 109
         return $this->buildIfSearch($ifType, 'begins-with', $variable, $search, $caseInsensitive);
110 110
     }
111 111
     
112
-    public function buildIfEndsWith(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
112
+    public function buildIfEndsWith(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
113 113
     {
114 114
         return $this->buildIfSearch($ifType, 'ends-with', $variable, $search, $caseInsensitive);
115 115
     }
@@ -159,11 +159,11 @@  discard block
 block discarded – undo
159 159
         );
160 160
     }
161 161
 
162
-    private function buildIfSearch(string $ifType, string $subType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
162
+    private function buildIfSearch(string $ifType, string $subType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
163 163
     {
164 164
         $keyword = ' ';
165 165
         
166
-        if($caseInsensitive)
166
+        if ($caseInsensitive)
167 167
         {
168 168
             $keyword = ' insensitive: ';
169 169
         }
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     
193 193
     public function checkCommand(Mailcode_Commands_Command $command) : void
194 194
     {
195
-        if($command->isValid())
195
+        if ($command->isValid())
196 196
         {
197 197
             return;
198 198
         }
Please login to merge, or discard this patch.
src/Mailcode/Traits/Commands/Validation/URLEncode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@
 block discarded – undo
34 34
     {
35 35
         $keywords = $this->params->getInfo()->getKeywords();
36 36
 
37
-        foreach($keywords as $keyword)
37
+        foreach ($keywords as $keyword)
38 38
         {
39
-            if($keyword->isURLEncoded())
39
+            if ($keyword->isURLEncoded())
40 40
             {
41 41
                 $this->urlencodeToken = $keyword;
42 42
 
Please login to merge, or discard this patch.