@@ -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,18 +253,18 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | $placeholders = $this->getPlaceholders(); |
| 255 | 255 | |
| 256 | - foreach($urls as $url) |
|
| 256 | + foreach ($urls as $url) |
|
| 257 | 257 | { |
| 258 | - foreach($placeholders as $placeholder) |
|
| 258 | + foreach ($placeholders as $placeholder) |
|
| 259 | 259 | { |
| 260 | 260 | $command = $placeholder->getCommand(); |
| 261 | 261 | |
| 262 | - if(!$command->supportsURLEncoding()) |
|
| 262 | + if (!$command->supportsURLEncoding()) |
|
| 263 | 263 | { |
| 264 | 264 | continue; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - if(strstr($url, $placeholder->getReplacementText()) && !$command->isURLDecoded()) |
|
| 267 | + if (strstr($url, $placeholder->getReplacementText()) && !$command->isURLDecoded()) |
|
| 268 | 268 | { |
| 269 | 269 | $command->setURLEncoding(true); |
| 270 | 270 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | public function createFormatting($subject) : Mailcode_Parser_Safeguard_Formatting |
| 283 | 283 | { |
| 284 | - if(is_string($subject)) |
|
| 284 | + if (is_string($subject)) |
|
| 285 | 285 | { |
| 286 | 286 | $subject = Mailcode::create()->createString($subject); |
| 287 | 287 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | */ |
| 298 | 298 | public function getPlaceholders() |
| 299 | 299 | { |
| 300 | - if(isset($this->placeholders)) |
|
| 300 | + if (isset($this->placeholders)) |
|
| 301 | 301 | { |
| 302 | 302 | return $this->placeholders; |
| 303 | 303 | } |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | $cmds = $this->getCollection()->getCommands(); |
| 308 | 308 | |
| 309 | - foreach($cmds as $command) |
|
| 309 | + foreach ($cmds as $command) |
|
| 310 | 310 | { |
| 311 | 311 | self::$counter++; |
| 312 | 312 | |
@@ -327,21 +327,21 @@ discard block |
||
| 327 | 327 | * @return string |
| 328 | 328 | * @throws Mailcode_Exception |
| 329 | 329 | */ |
| 330 | - protected function restore(string $string, bool $partial=false, bool $highlighted=false) : string |
|
| 330 | + protected function restore(string $string, bool $partial = false, bool $highlighted = false) : string |
|
| 331 | 331 | { |
| 332 | - if(!$partial) |
|
| 332 | + if (!$partial) |
|
| 333 | 333 | { |
| 334 | 334 | $this->requireValidCollection(); |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | $formatting = $this->createFormatting($string); |
| 338 | 338 | |
| 339 | - if($partial) |
|
| 339 | + if ($partial) |
|
| 340 | 340 | { |
| 341 | 341 | $formatting->makePartial(); |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | - if($highlighted) |
|
| 344 | + if ($highlighted) |
|
| 345 | 345 | { |
| 346 | 346 | $formatting->replaceWithHTMLHighlighting(); |
| 347 | 347 | } |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | { |
| 362 | 362 | $command = $placeholder->getCommand(); |
| 363 | 363 | |
| 364 | - if($command instanceof Mailcode_Interfaces_Commands_ProtectedContent) |
|
| 364 | + if ($command instanceof Mailcode_Interfaces_Commands_ProtectedContent) |
|
| 365 | 365 | { |
| 366 | 366 | $string = $command->restoreContent($string); |
| 367 | 367 | } |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | public function getCollection() : Mailcode_Collection |
| 456 | 456 | { |
| 457 | - if(isset($this->collection)) |
|
| 457 | + if (isset($this->collection)) |
|
| 458 | 458 | { |
| 459 | 459 | return $this->collection; |
| 460 | 460 | } |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | */ |
| 477 | 477 | protected function requireValidCollection() : void |
| 478 | 478 | { |
| 479 | - if($this->getCollection()->isValid()) |
|
| 479 | + if ($this->getCollection()->isValid()) |
|
| 480 | 480 | { |
| 481 | 481 | return; |
| 482 | 482 | } |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | */ |
| 500 | 500 | public function getPlaceholderStrings() : array |
| 501 | 501 | { |
| 502 | - if(is_array($this->placeholderStrings)) |
|
| 502 | + if (is_array($this->placeholderStrings)) |
|
| 503 | 503 | { |
| 504 | 504 | return $this->placeholderStrings; |
| 505 | 505 | } |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | |
| 509 | 509 | $this->placeholderStrings = array(); |
| 510 | 510 | |
| 511 | - foreach($placeholders as $placeholder) |
|
| 511 | + foreach ($placeholders as $placeholder) |
|
| 512 | 512 | { |
| 513 | 513 | $this->placeholderStrings[] = $placeholder->getReplacementText(); |
| 514 | 514 | } |
@@ -534,9 +534,9 @@ discard block |
||
| 534 | 534 | { |
| 535 | 535 | $placeholders = $this->getPlaceholders(); |
| 536 | 536 | |
| 537 | - foreach($placeholders as $placeholder) |
|
| 537 | + foreach ($placeholders as $placeholder) |
|
| 538 | 538 | { |
| 539 | - if($placeholder->getID() === $id) |
|
| 539 | + if ($placeholder->getID() === $id) |
|
| 540 | 540 | { |
| 541 | 541 | return $placeholder; |
| 542 | 542 | } |
@@ -563,9 +563,9 @@ discard block |
||
| 563 | 563 | { |
| 564 | 564 | $placeholders = $this->getPlaceholders(); |
| 565 | 565 | |
| 566 | - foreach($placeholders as $placeholder) |
|
| 566 | + foreach ($placeholders as $placeholder) |
|
| 567 | 567 | { |
| 568 | - if($placeholder->getReplacementText() === $string) |
|
| 568 | + if ($placeholder->getReplacementText() === $string) |
|
| 569 | 569 | { |
| 570 | 570 | return $placeholder; |
| 571 | 571 | } |