@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function setDelimiter(string $delimiter) : Mailcode_Parser_Safeguard |
125 | 125 | { |
126 | - if(empty($delimiter)) |
|
126 | + if (empty($delimiter)) |
|
127 | 127 | { |
128 | 128 | throw new Mailcode_Exception( |
129 | 129 | 'Empty delimiter', |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $placeholders = $this->getPlaceholders(); |
174 | 174 | $string = $this->originalString; |
175 | 175 | |
176 | - foreach($placeholders as $placeholder) |
|
176 | + foreach ($placeholders as $placeholder) |
|
177 | 177 | { |
178 | 178 | $string = $this->makePlaceholderSafe($string, $placeholder); |
179 | 179 | } |
@@ -203,14 +203,14 @@ discard block |
||
203 | 203 | $placeholders = $this->getPlaceholders(); |
204 | 204 | $total = count($placeholders); |
205 | 205 | |
206 | - for($i=0; $i < $total; $i++) |
|
206 | + for ($i = 0; $i < $total; $i++) |
|
207 | 207 | { |
208 | 208 | $placeholder = $placeholders[$i]; |
209 | 209 | $command = $placeholder->getCommand(); |
210 | 210 | |
211 | - if($command instanceof Mailcode_Interfaces_Commands_ProtectedContent) |
|
211 | + if ($command instanceof Mailcode_Interfaces_Commands_ProtectedContent) |
|
212 | 212 | { |
213 | - $string = $command->protectContent($string, $placeholder, $placeholders[$i+1]); |
|
213 | + $string = $command->protectContent($string, $placeholder, $placeholders[$i + 1]); |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | { |
222 | 222 | $pos = mb_strpos($string, $placeholder->getOriginalText()); |
223 | 223 | |
224 | - if($pos === false) |
|
224 | + if ($pos === false) |
|
225 | 225 | { |
226 | 226 | throw new Mailcode_Exception( |
227 | 227 | 'Placeholder original text not found', |
@@ -253,23 +253,23 @@ discard block |
||
253 | 253 | |
254 | 254 | $placeholders = $this->getPlaceholders(); |
255 | 255 | |
256 | - foreach($urls as $url) |
|
256 | + foreach ($urls as $url) |
|
257 | 257 | { |
258 | - if(stristr($url, 'tel:')) |
|
258 | + if (stristr($url, 'tel:')) |
|
259 | 259 | { |
260 | 260 | continue; |
261 | 261 | } |
262 | 262 | |
263 | - foreach($placeholders as $placeholder) |
|
263 | + foreach ($placeholders as $placeholder) |
|
264 | 264 | { |
265 | 265 | $command = $placeholder->getCommand(); |
266 | 266 | |
267 | - if(!$command->supportsURLEncoding()) |
|
267 | + if (!$command->supportsURLEncoding()) |
|
268 | 268 | { |
269 | 269 | continue; |
270 | 270 | } |
271 | 271 | |
272 | - if(strstr($url, $placeholder->getReplacementText()) && !$command->isURLDecoded()) |
|
272 | + if (strstr($url, $placeholder->getReplacementText()) && !$command->isURLDecoded()) |
|
273 | 273 | { |
274 | 274 | $command->setURLEncoding(true); |
275 | 275 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | */ |
287 | 287 | public function createFormatting($subject) : Mailcode_Parser_Safeguard_Formatting |
288 | 288 | { |
289 | - if(is_string($subject)) |
|
289 | + if (is_string($subject)) |
|
290 | 290 | { |
291 | 291 | $subject = Mailcode::create()->createString($subject); |
292 | 292 | } |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function getPlaceholders() |
304 | 304 | { |
305 | - if(isset($this->placeholders)) |
|
305 | + if (isset($this->placeholders)) |
|
306 | 306 | { |
307 | 307 | return $this->placeholders; |
308 | 308 | } |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | |
312 | 312 | $cmds = $this->getCollection()->getCommands(); |
313 | 313 | |
314 | - foreach($cmds as $command) |
|
314 | + foreach ($cmds as $command) |
|
315 | 315 | { |
316 | 316 | self::$counter++; |
317 | 317 | |
@@ -332,21 +332,21 @@ discard block |
||
332 | 332 | * @return string |
333 | 333 | * @throws Mailcode_Exception |
334 | 334 | */ |
335 | - protected function restore(string $string, bool $partial=false, bool $highlighted=false) : string |
|
335 | + protected function restore(string $string, bool $partial = false, bool $highlighted = false) : string |
|
336 | 336 | { |
337 | - if(!$partial) |
|
337 | + if (!$partial) |
|
338 | 338 | { |
339 | 339 | $this->requireValidCollection(); |
340 | 340 | } |
341 | 341 | |
342 | 342 | $formatting = $this->createFormatting($string); |
343 | 343 | |
344 | - if($partial) |
|
344 | + if ($partial) |
|
345 | 345 | { |
346 | 346 | $formatting->makePartial(); |
347 | 347 | } |
348 | 348 | |
349 | - if($highlighted) |
|
349 | + if ($highlighted) |
|
350 | 350 | { |
351 | 351 | $formatting->replaceWithHTMLHighlighting(); |
352 | 352 | } |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | { |
367 | 367 | $command = $placeholder->getCommand(); |
368 | 368 | |
369 | - if($command instanceof Mailcode_Interfaces_Commands_ProtectedContent) |
|
369 | + if ($command instanceof Mailcode_Interfaces_Commands_ProtectedContent) |
|
370 | 370 | { |
371 | 371 | $string = $command->restoreContent($string); |
372 | 372 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | */ |
460 | 460 | public function getCollection() : Mailcode_Collection |
461 | 461 | { |
462 | - if(isset($this->collection)) |
|
462 | + if (isset($this->collection)) |
|
463 | 463 | { |
464 | 464 | return $this->collection; |
465 | 465 | } |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | */ |
482 | 482 | protected function requireValidCollection() : void |
483 | 483 | { |
484 | - if($this->getCollection()->isValid()) |
|
484 | + if ($this->getCollection()->isValid()) |
|
485 | 485 | { |
486 | 486 | return; |
487 | 487 | } |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | */ |
505 | 505 | public function getPlaceholderStrings() : array |
506 | 506 | { |
507 | - if(is_array($this->placeholderStrings)) |
|
507 | + if (is_array($this->placeholderStrings)) |
|
508 | 508 | { |
509 | 509 | return $this->placeholderStrings; |
510 | 510 | } |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | |
514 | 514 | $this->placeholderStrings = array(); |
515 | 515 | |
516 | - foreach($placeholders as $placeholder) |
|
516 | + foreach ($placeholders as $placeholder) |
|
517 | 517 | { |
518 | 518 | $this->placeholderStrings[] = $placeholder->getReplacementText(); |
519 | 519 | } |
@@ -539,9 +539,9 @@ discard block |
||
539 | 539 | { |
540 | 540 | $placeholders = $this->getPlaceholders(); |
541 | 541 | |
542 | - foreach($placeholders as $placeholder) |
|
542 | + foreach ($placeholders as $placeholder) |
|
543 | 543 | { |
544 | - if($placeholder->getID() === $id) |
|
544 | + if ($placeholder->getID() === $id) |
|
545 | 545 | { |
546 | 546 | return $placeholder; |
547 | 547 | } |
@@ -568,9 +568,9 @@ discard block |
||
568 | 568 | { |
569 | 569 | $placeholders = $this->getPlaceholders(); |
570 | 570 | |
571 | - foreach($placeholders as $placeholder) |
|
571 | + foreach ($placeholders as $placeholder) |
|
572 | 572 | { |
573 | - if($placeholder->getReplacementText() === $string) |
|
573 | + if ($placeholder->getReplacementText() === $string) |
|
574 | 574 | { |
575 | 575 | return $placeholder; |
576 | 576 | } |