@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | protected $comment = ''; |
81 | 81 | |
82 | - public function __construct(string $type='', string $paramsString='', string $matchedText='') |
|
82 | + public function __construct(string $type = '', string $paramsString = '', string $matchedText = '') |
|
83 | 83 | { |
84 | 84 | $this->type = $type; |
85 | 85 | $this->paramsString = $paramsString; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | $this->requireNonDummy(); |
152 | 152 | |
153 | - if($this->hash === '') { |
|
153 | + if ($this->hash === '') { |
|
154 | 154 | $this->hash = md5($this->matchedText); |
155 | 155 | } |
156 | 156 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | protected function requireNonDummy() : void |
161 | 161 | { |
162 | - if(!$this->isDummy()) |
|
162 | + if (!$this->isDummy()) |
|
163 | 163 | { |
164 | 164 | return; |
165 | 165 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | { |
181 | 181 | $this->requireNonDummy(); |
182 | 182 | |
183 | - if(isset($this->validationResult)) |
|
183 | + if (isset($this->validationResult)) |
|
184 | 184 | { |
185 | 185 | return $this->validationResult; |
186 | 186 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | public function getValidationResult() : \AppUtils\OperationResult |
196 | 196 | { |
197 | - if(isset($this->validationResult)) |
|
197 | + if (isset($this->validationResult)) |
|
198 | 198 | { |
199 | 199 | return $this->validationResult; |
200 | 200 | } |
@@ -210,11 +210,11 @@ discard block |
||
210 | 210 | { |
211 | 211 | $validations = array_merge($this->validations, $this->getValidations()); |
212 | 212 | |
213 | - foreach($validations as $validation) |
|
213 | + foreach ($validations as $validation) |
|
214 | 214 | { |
215 | 215 | $method = 'validateSyntax_'.$validation; |
216 | 216 | |
217 | - if(!method_exists($this, $method)) |
|
217 | + if (!method_exists($this, $method)) |
|
218 | 218 | { |
219 | 219 | throw new Mailcode_Exception( |
220 | 220 | 'Missing validation method', |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $this->$method(); |
231 | 231 | |
232 | 232 | // break off at the first validation issue |
233 | - if(!$this->validationResult->isValid()) |
|
233 | + if (!$this->validationResult->isValid()) |
|
234 | 234 | { |
235 | 235 | return; |
236 | 236 | } |
@@ -244,12 +244,12 @@ discard block |
||
244 | 244 | |
245 | 245 | protected function validateSyntax_params() : void |
246 | 246 | { |
247 | - if(!$this->requiresParameters()) |
|
247 | + if (!$this->requiresParameters()) |
|
248 | 248 | { |
249 | 249 | return; |
250 | 250 | } |
251 | 251 | |
252 | - if(empty($this->paramsString)) |
|
252 | + if (empty($this->paramsString)) |
|
253 | 253 | { |
254 | 254 | $this->validationResult->makeError( |
255 | 255 | t('Parameters have to be specified.'), |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | $this->params = $this->mailcode->getParser()->createStatement($this->paramsString); |
262 | 262 | |
263 | - if(!$this->params->isValid()) |
|
263 | + if (!$this->params->isValid()) |
|
264 | 264 | { |
265 | 265 | $error = $this->params->getValidationResult(); |
266 | 266 | |
@@ -273,14 +273,14 @@ discard block |
||
273 | 273 | |
274 | 274 | protected function validateSyntax_type_supported() : void |
275 | 275 | { |
276 | - if(!$this->supportsType() || empty($this->type)) |
|
276 | + if (!$this->supportsType() || empty($this->type)) |
|
277 | 277 | { |
278 | 278 | return; |
279 | 279 | } |
280 | 280 | |
281 | 281 | $types = $this->getSupportedTypes(); |
282 | 282 | |
283 | - if(!in_array($this->type, $types)) |
|
283 | + if (!in_array($this->type, $types)) |
|
284 | 284 | { |
285 | 285 | $this->validationResult->makeError( |
286 | 286 | t('The command addon %1$s is not supported.', $this->type).' '. |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | |
295 | 295 | protected function validateSyntax_type_unsupported() : void |
296 | 296 | { |
297 | - if($this->supportsType() || empty($this->type)) |
|
297 | + if ($this->supportsType() || empty($this->type)) |
|
298 | 298 | { |
299 | 299 | return; |
300 | 300 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | public function getType() : string |
314 | 314 | { |
315 | - if($this->supportsType()) |
|
315 | + if ($this->supportsType()) |
|
316 | 316 | { |
317 | 317 | return $this->type; |
318 | 318 | } |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | public function getHighlighted() : string |
334 | 334 | { |
335 | - if(!$this->isValid()) |
|
335 | + if (!$this->isValid()) |
|
336 | 336 | { |
337 | 337 | return ''; |
338 | 338 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | |
344 | 344 | public function getParamsString() : string |
345 | 345 | { |
346 | - if($this->requiresParameters()) |
|
346 | + if ($this->requiresParameters()) |
|
347 | 347 | { |
348 | 348 | return $this->paramsString; |
349 | 349 | } |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | |
371 | 371 | public function getNormalized() : string |
372 | 372 | { |
373 | - if(!$this->isValid()) |
|
373 | + if (!$this->isValid()) |
|
374 | 374 | { |
375 | 375 | return ''; |
376 | 376 | } |
@@ -378,12 +378,12 @@ discard block |
||
378 | 378 | $parts = array(); |
379 | 379 | $parts[] = '{'.$this->getName(); |
380 | 380 | |
381 | - if($this->supportsType() && $this->hasType()) |
|
381 | + if ($this->supportsType() && $this->hasType()) |
|
382 | 382 | { |
383 | 383 | $parts[] = ' '.$this->getType(); |
384 | 384 | } |
385 | 385 | |
386 | - if($this->requiresParameters() && isset($this->params)) |
|
386 | + if ($this->requiresParameters() && isset($this->params)) |
|
387 | 387 | { |
388 | 388 | $parts[] = ': '; |
389 | 389 | $parts[] = $this->params->getNormalized(); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function setDelimiter(string $delimiter) : Mailcode_Parser_Safeguard |
117 | 117 | { |
118 | - if(empty($delimiter)) |
|
118 | + if (empty($delimiter)) |
|
119 | 119 | { |
120 | 120 | throw new Mailcode_Exception( |
121 | 121 | 'Empty delimiter', |
@@ -156,17 +156,17 @@ discard block |
||
156 | 156 | * @param bool $highlighted |
157 | 157 | * @return string[]string |
158 | 158 | */ |
159 | - protected function getReplaces(bool $highlighted=false) : array |
|
159 | + protected function getReplaces(bool $highlighted = false) : array |
|
160 | 160 | { |
161 | 161 | $placeholders = $this->getPlaceholders(); |
162 | 162 | |
163 | 163 | $replaces = array(); |
164 | 164 | |
165 | - foreach($placeholders as $placeholder) |
|
165 | + foreach ($placeholders as $placeholder) |
|
166 | 166 | { |
167 | 167 | $replace = ''; |
168 | 168 | |
169 | - if($highlighted) |
|
169 | + if ($highlighted) |
|
170 | 170 | { |
171 | 171 | $replace = $placeholder->getHighlightedText(); |
172 | 172 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function getPlaceholders() |
192 | 192 | { |
193 | - if(isset($this->placeholders)) |
|
193 | + if (isset($this->placeholders)) |
|
194 | 194 | { |
195 | 195 | return $this->placeholders; |
196 | 196 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | $cmds = $this->getCollection()->getGroupedByHash(); |
201 | 201 | |
202 | - foreach($cmds as $command) |
|
202 | + foreach ($cmds as $command) |
|
203 | 203 | { |
204 | 204 | self::$counter++; |
205 | 205 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | return $this->placeholders; |
214 | 214 | } |
215 | 215 | |
216 | - protected function restore(string $string, bool $highlighted=false) : string |
|
216 | + protected function restore(string $string, bool $highlighted = false) : string |
|
217 | 217 | { |
218 | 218 | $this->requireValidCollection(); |
219 | 219 | |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | |
222 | 222 | $placeholderStrings = array_keys($replaces); |
223 | 223 | |
224 | - foreach($placeholderStrings as $search) |
|
224 | + foreach ($placeholderStrings as $search) |
|
225 | 225 | { |
226 | - if(!strstr($string, $search)) |
|
226 | + if (!strstr($string, $search)) |
|
227 | 227 | { |
228 | 228 | throw new Mailcode_Exception( |
229 | 229 | 'Command placeholder not found', |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | */ |
282 | 282 | public function getCollection() : Mailcode_Collection |
283 | 283 | { |
284 | - if(isset($this->collection)) |
|
284 | + if (isset($this->collection)) |
|
285 | 285 | { |
286 | 286 | return $this->collection; |
287 | 287 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | protected function requireValidCollection() : void |
305 | 305 | { |
306 | - if($this->getCollection()->isValid()) |
|
306 | + if ($this->getCollection()->isValid()) |
|
307 | 307 | { |
308 | 308 | return; |
309 | 309 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public function getPlaceholderStrings() : array |
327 | 327 | { |
328 | - if(isset($this->placeholderStrings)) |
|
328 | + if (isset($this->placeholderStrings)) |
|
329 | 329 | { |
330 | 330 | return $this->placeholderStrings; |
331 | 331 | } |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | |
335 | 335 | $this->placeholderStrings = array(); |
336 | 336 | |
337 | - foreach($placeholders as $placeholder) |
|
337 | + foreach ($placeholders as $placeholder) |
|
338 | 338 | { |
339 | 339 | $this->placeholderStrings[] = $placeholder->getReplacementText(); |
340 | 340 | } |
@@ -360,9 +360,9 @@ discard block |
||
360 | 360 | { |
361 | 361 | $placeholders = $this->getPlaceholders(); |
362 | 362 | |
363 | - foreach($placeholders as $placeholder) |
|
363 | + foreach ($placeholders as $placeholder) |
|
364 | 364 | { |
365 | - if($placeholder->getID() === $id) |
|
365 | + if ($placeholder->getID() === $id) |
|
366 | 366 | { |
367 | 367 | return $placeholder; |
368 | 368 | } |
@@ -389,9 +389,9 @@ discard block |
||
389 | 389 | { |
390 | 390 | $placeholders = $this->getPlaceholders(); |
391 | 391 | |
392 | - foreach($placeholders as $placeholder) |
|
392 | + foreach ($placeholders as $placeholder) |
|
393 | 393 | { |
394 | - if($placeholder->getReplacementText() === $string) |
|
394 | + if ($placeholder->getReplacementText() === $string) |
|
395 | 395 | { |
396 | 396 | return $placeholder; |
397 | 397 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @param bool $highlighted |
33 | 33 | * @return Mailcode_Renderer |
34 | 34 | */ |
35 | - public function setOutputHighlighted(bool $highlighted=true) : Mailcode_Renderer |
|
35 | + public function setOutputHighlighted(bool $highlighted = true) : Mailcode_Renderer |
|
36 | 36 | { |
37 | 37 | $this->highlighted = $highlighted; |
38 | 38 | |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | return $this->command2string(Mailcode_Factory::setVarString($variableName, $value)); |
61 | 61 | } |
62 | 62 | |
63 | - public function if(string $condition, string $type='') : string |
|
63 | + public function if (string $condition, string $type = '') : string |
|
64 | 64 | { |
65 | - return $this->command2string(Mailcode_Factory::if($condition, $type)); |
|
65 | + return $this->command2string(Mailcode_Factory::if ($condition, $type)); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | public function ifVar(string $variable, string $operand, string $value, bool $quoteValue) : string |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | return $this->command2string(Mailcode_Factory::ifVarNotEqualsString($variable, $value)); |
96 | 96 | } |
97 | 97 | |
98 | - public function elseIf(string $condition, string $type='') : string |
|
98 | + public function elseIf (string $condition, string $type = '') : string |
|
99 | 99 | { |
100 | - return $this->command2string(Mailcode_Factory::elseIf($condition, $type)); |
|
100 | + return $this->command2string(Mailcode_Factory::elseIf ($condition, $type)); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | public function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue) : string |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | protected function command2string(Mailcode_Commands_Command $command) : string |
149 | 149 | { |
150 | - if($this->highlighted) |
|
150 | + if ($this->highlighted) |
|
151 | 151 | { |
152 | 152 | return $command->getHighlighted(); |
153 | 153 | } |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | { |
63 | 63 | $fullName = $this->fixName($fullName); |
64 | 64 | |
65 | - foreach($this->variables as $variable) |
|
65 | + foreach ($this->variables as $variable) |
|
66 | 66 | { |
67 | - if($variable->getFullName() === $fullName) |
|
67 | + if ($variable->getFullName() === $fullName) |
|
68 | 68 | { |
69 | 69 | return true; |
70 | 70 | } |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | |
88 | 88 | $collection = new Mailcode_Variables_Collection_Regular(); |
89 | 89 | |
90 | - foreach($this->variables as $variable) |
|
90 | + foreach ($this->variables as $variable) |
|
91 | 91 | { |
92 | - if($variable->getFullName() === $fullName) |
|
92 | + if ($variable->getFullName() === $fullName) |
|
93 | 93 | { |
94 | 94 | $collection->add($variable); |
95 | 95 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | protected function fixName(string $fullName) : string |
108 | 108 | { |
109 | - if(substr($fullName, 0, 1) === '$') |
|
109 | + if (substr($fullName, 0, 1) === '$') |
|
110 | 110 | { |
111 | 111 | return $fullName; |
112 | 112 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | $entries = array(); |
126 | 126 | |
127 | - foreach($this->variables as $variable) |
|
127 | + foreach ($this->variables as $variable) |
|
128 | 128 | { |
129 | 129 | $entries[$variable->getHash()] = $variable; |
130 | 130 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | { |
142 | 142 | $entries = array(); |
143 | 143 | |
144 | - foreach($this->variables as $variable) |
|
144 | + foreach ($this->variables as $variable) |
|
145 | 145 | { |
146 | 146 | $entries[$variable->getFullName()] = $variable; |
147 | 147 | } |
@@ -166,11 +166,11 @@ discard block |
||
166 | 166 | { |
167 | 167 | $result = array(); |
168 | 168 | |
169 | - foreach($this->variables as $variable) |
|
169 | + foreach ($this->variables as $variable) |
|
170 | 170 | { |
171 | 171 | $name = $variable->getFullName(); |
172 | 172 | |
173 | - if(!in_array($name, $result)) |
|
173 | + if (!in_array($name, $result)) |
|
174 | 174 | { |
175 | 175 | $result[] = $name; |
176 | 176 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | { |
210 | 210 | $variables = $collection->getGroupedByHash(); |
211 | 211 | |
212 | - foreach($variables as $variable) |
|
212 | + foreach ($variables as $variable) |
|
213 | 213 | { |
214 | 214 | $this->add($variable); |
215 | 215 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | { |
222 | 222 | $variables = $this->getAll(); |
223 | 223 | |
224 | - if(!empty($variables)) |
|
224 | + if (!empty($variables)) |
|
225 | 225 | { |
226 | 226 | return array_shift($variables); |
227 | 227 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | public function getFullName() : string |
78 | 78 | { |
79 | - if(empty($this->path)) |
|
79 | + if (empty($this->path)) |
|
80 | 80 | { |
81 | 81 | return '$'.$this->name; |
82 | 82 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | public function getHash() : string |
103 | 103 | { |
104 | - if(empty($this->hash)) |
|
104 | + if (empty($this->hash)) |
|
105 | 105 | { |
106 | 106 | $this->hash = md5($this->matchedText); |
107 | 107 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | public function getValidationResult() : OperationResult |
118 | 118 | { |
119 | - if(isset($this->validationResult)) |
|
119 | + if (isset($this->validationResult)) |
|
120 | 120 | { |
121 | 121 | return $this->validationResult; |
122 | 122 | } |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | |
131 | 131 | protected function validate() : void |
132 | 132 | { |
133 | - foreach($this->validations as $validation) |
|
133 | + foreach ($this->validations as $validation) |
|
134 | 134 | { |
135 | 135 | $method = 'validate_'.$validation; |
136 | 136 | |
137 | - if(!method_exists($this, $method)) |
|
137 | + if (!method_exists($this, $method)) |
|
138 | 138 | { |
139 | 139 | throw new Mailcode_Exception( |
140 | 140 | 'Unknown validation method', |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | $this->$method(); |
151 | 151 | |
152 | - if(!$this->validationResult->isValid()) |
|
152 | + if (!$this->validationResult->isValid()) |
|
153 | 153 | { |
154 | 154 | return; |
155 | 155 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | |
179 | 179 | protected function validateNumber(string $value, int $errorCode) : void |
180 | 180 | { |
181 | - if(!is_numeric(substr($value, 0, 1))) |
|
181 | + if (!is_numeric(substr($value, 0, 1))) |
|
182 | 182 | { |
183 | 183 | return; |
184 | 184 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | protected function validateUnderscore(string $value, int $errorCode) : void |
197 | 197 | { |
198 | 198 | // allow empty paths |
199 | - if(empty($value)) |
|
199 | + if (empty($value)) |
|
200 | 200 | { |
201 | 201 | return; |
202 | 202 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $length = strlen($value); |
205 | 205 | |
206 | 206 | // trimming underscores does not change the length: no underscores at start or end of string. |
207 | - if(strlen(trim($value, '_')) == $length) |
|
207 | + if (strlen(trim($value, '_')) == $length) |
|
208 | 208 | { |
209 | 209 | return; |
210 | 210 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $errors = $this->errors; |
99 | 99 | |
100 | - if(!$result->isValid()) |
|
100 | + if (!$result->isValid()) |
|
101 | 101 | { |
102 | 102 | $errors[] = new Mailcode_Collection_Error_Message( |
103 | 103 | '', |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | { |
140 | 140 | $hashes = array(); |
141 | 141 | |
142 | - foreach($this->commands as $command) |
|
142 | + foreach ($this->commands as $command) |
|
143 | 143 | { |
144 | 144 | $hash = $command->getHash(); |
145 | 145 | |
146 | - if(!isset($hashes[$hash])) |
|
146 | + if (!isset($hashes[$hash])) |
|
147 | 147 | { |
148 | 148 | $hashes[$hash] = $command; |
149 | 149 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function addCommands(array $commands) : Mailcode_Collection |
162 | 162 | { |
163 | - foreach($commands as $command) |
|
163 | + foreach ($commands as $command) |
|
164 | 164 | { |
165 | 165 | $this->addCommand($command); |
166 | 166 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | { |
180 | 180 | $collection = new Mailcode_Variables_Collection_Regular(); |
181 | 181 | |
182 | - foreach($this->commands as $command) |
|
182 | + foreach ($this->commands as $command) |
|
183 | 183 | { |
184 | 184 | $collection->mergeWith($command->getVariables()); |
185 | 185 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | public function getValidationResult() : OperationResult |
191 | 191 | { |
192 | - if(isset($this->validationResult)) |
|
192 | + if (isset($this->validationResult)) |
|
193 | 193 | { |
194 | 194 | return $this->validationResult; |
195 | 195 | } |
@@ -205,9 +205,9 @@ discard block |
||
205 | 205 | { |
206 | 206 | $errors = $this->getErrors(); |
207 | 207 | |
208 | - foreach($errors as $error) |
|
208 | + foreach ($errors as $error) |
|
209 | 209 | { |
210 | - if($error->getCode() === $code) |
|
210 | + if ($error->getCode() === $code) |
|
211 | 211 | { |
212 | 212 | return true; |
213 | 213 | } |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | { |
226 | 226 | $result = array(); |
227 | 227 | |
228 | - foreach($this->commands as $command) |
|
228 | + foreach ($this->commands as $command) |
|
229 | 229 | { |
230 | - if($command instanceof Mailcode_Commands_Command_ShowVariable) |
|
230 | + if ($command instanceof Mailcode_Commands_Command_ShowVariable) |
|
231 | 231 | { |
232 | 232 | $result[] = $command; |
233 | 233 | } |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | { |
241 | 241 | $commands = $this->getCommands(); |
242 | 242 | |
243 | - if(!empty($commands)) |
|
243 | + if (!empty($commands)) |
|
244 | 244 | { |
245 | 245 | return array_shift($commands); |
246 | 246 | } |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | $matches = array(); |
41 | 41 | preg_match_all(self::REGEX_VARIABLE_NAME, $subject, $matches, PREG_PATTERN_ORDER); |
42 | 42 | |
43 | - if(!isset($matches[0]) || empty($matches[0])) |
|
43 | + if (!isset($matches[0]) || empty($matches[0])) |
|
44 | 44 | { |
45 | 45 | return $this->collection; |
46 | 46 | } |
47 | 47 | |
48 | - foreach($matches[0] as $idx => $matchedText) |
|
48 | + foreach ($matches[0] as $idx => $matchedText) |
|
49 | 49 | { |
50 | - if(!empty($matches[3][$idx])) |
|
50 | + if (!empty($matches[3][$idx])) |
|
51 | 51 | { |
52 | 52 | $this->addSingle($matches[3][$idx], $matchedText); |
53 | 53 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | protected function addSingle(string $name, string $matchedText) : void |
64 | 64 | { |
65 | 65 | // ignore US style numbers like $451 |
66 | - if(is_numeric($name)) |
|
66 | + if (is_numeric($name)) |
|
67 | 67 | { |
68 | 68 | return; |
69 | 69 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | protected function addPathed(string $path, string $name, string $matchedText) : void |
75 | 75 | { |
76 | 76 | // ignore US style numbers like $45.12 |
77 | - if(is_numeric($path.'.'.$name)) |
|
77 | + if (is_numeric($path.'.'.$name)) |
|
78 | 78 | { |
79 | 79 | return; |
80 | 80 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | $params = $command->getParams(); |
26 | 26 | |
27 | - if($params) |
|
27 | + if ($params) |
|
28 | 28 | { |
29 | 29 | return sprintf( |
30 | 30 | '#elseif(%s)', |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | $params = $command->getParams(); |
46 | 46 | |
47 | - if($params) |
|
47 | + if ($params) |
|
48 | 48 | { |
49 | 49 | return sprintf( |
50 | 50 | '#if(%s)', |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $params = $command->getParams(); |
66 | 66 | |
67 | - if($params) |
|
67 | + if ($params) |
|
68 | 68 | { |
69 | 69 | return sprintf( |
70 | 70 | '#for(%s)', |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | { |
80 | 80 | $params = $command->getParams(); |
81 | 81 | |
82 | - if($params) |
|
82 | + if ($params) |
|
83 | 83 | { |
84 | 84 | return sprintf( |
85 | 85 | '#set(%s)', |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $method = '_translate'.$id; |
49 | 49 | |
50 | - if(!method_exists($this, $method)) |
|
50 | + if (!method_exists($this, $method)) |
|
51 | 51 | { |
52 | 52 | throw new Mailcode_Translator_Exception( |
53 | 53 | 'Unknown command type in translator', |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $subject = $safeguard->makeSafe(); |
76 | 76 | |
77 | - if(!$safeguard->hasPlaceholders()) |
|
77 | + if (!$safeguard->hasPlaceholders()) |
|
78 | 78 | { |
79 | 79 | return $subject; |
80 | 80 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $replaces = array(); |
85 | 85 | |
86 | - foreach($placeholders as $placeholder) |
|
86 | + foreach ($placeholders as $placeholder) |
|
87 | 87 | { |
88 | 88 | $replaces[$placeholder->getReplacementText()] = $this->translateCommand($placeholder->getCommand()); |
89 | 89 | } |