@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function setDelimiter(string $delimiter) : Mailcode_Parser_Safeguard |
| 130 | 130 | { |
| 131 | - if(empty($delimiter)) |
|
| 131 | + if (empty($delimiter)) |
|
| 132 | 132 | { |
| 133 | 133 | throw new Mailcode_Exception( |
| 134 | 134 | 'Empty delimiter', |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $placeholders = $this->getPlaceholders(); |
| 179 | 179 | $string = $this->originalString; |
| 180 | 180 | |
| 181 | - foreach($placeholders as $placeholder) |
|
| 181 | + foreach ($placeholders as $placeholder) |
|
| 182 | 182 | { |
| 183 | 183 | $string = $this->makePlaceholderSafe($string, $placeholder); |
| 184 | 184 | } |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | { |
| 193 | 193 | $pos = mb_strpos($string, $placeholder->getOriginalText()); |
| 194 | 194 | |
| 195 | - if($pos === false) |
|
| 195 | + if ($pos === false) |
|
| 196 | 196 | { |
| 197 | 197 | throw new Mailcode_Exception( |
| 198 | 198 | 'Placeholder original text not found', |
@@ -224,18 +224,18 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | $placeholders = $this->getPlaceholders(); |
| 226 | 226 | |
| 227 | - foreach($urls as $url) |
|
| 227 | + foreach ($urls as $url) |
|
| 228 | 228 | { |
| 229 | - foreach($placeholders as $placeholder) |
|
| 229 | + foreach ($placeholders as $placeholder) |
|
| 230 | 230 | { |
| 231 | 231 | $command = $placeholder->getCommand(); |
| 232 | 232 | |
| 233 | - if(!$command->supportsURLEncoding()) |
|
| 233 | + if (!$command->supportsURLEncoding()) |
|
| 234 | 234 | { |
| 235 | 235 | continue; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - if(strstr($url, $placeholder->getReplacementText())) |
|
| 238 | + if (strstr($url, $placeholder->getReplacementText())) |
|
| 239 | 239 | { |
| 240 | 240 | $command->setURLEncoding(true); |
| 241 | 241 | } |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | public function createFormatting($subject) : Mailcode_Parser_Safeguard_Formatting |
| 254 | 254 | { |
| 255 | - if(is_string($subject)) |
|
| 255 | + if (is_string($subject)) |
|
| 256 | 256 | { |
| 257 | 257 | $subject = Mailcode::create()->createString($subject); |
| 258 | 258 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | public function getPlaceholders() |
| 270 | 270 | { |
| 271 | - if(isset($this->placeholders)) |
|
| 271 | + if (isset($this->placeholders)) |
|
| 272 | 272 | { |
| 273 | 273 | return $this->placeholders; |
| 274 | 274 | } |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | $cmds = $this->getCollection()->getCommands(); |
| 279 | 279 | |
| 280 | - foreach($cmds as $command) |
|
| 280 | + foreach ($cmds as $command) |
|
| 281 | 281 | { |
| 282 | 282 | self::$counter++; |
| 283 | 283 | |
@@ -291,21 +291,21 @@ discard block |
||
| 291 | 291 | return $this->placeholders; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - protected function restore(string $string, bool $partial=false, bool $highlighted=false) : string |
|
| 294 | + protected function restore(string $string, bool $partial = false, bool $highlighted = false) : string |
|
| 295 | 295 | { |
| 296 | - if(!$partial) |
|
| 296 | + if (!$partial) |
|
| 297 | 297 | { |
| 298 | 298 | $this->requireValidCollection(); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | $formatting = $this->createFormatting($string); |
| 302 | 302 | |
| 303 | - if($partial) |
|
| 303 | + if ($partial) |
|
| 304 | 304 | { |
| 305 | 305 | $formatting->makePartial(); |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | - if($highlighted) |
|
| 308 | + if ($highlighted) |
|
| 309 | 309 | { |
| 310 | 310 | $formatting->replaceWithHTMLHighlighting(); |
| 311 | 311 | } |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | */ |
| 402 | 402 | public function getCollection() : Mailcode_Collection |
| 403 | 403 | { |
| 404 | - if(isset($this->collection)) |
|
| 404 | + if (isset($this->collection)) |
|
| 405 | 405 | { |
| 406 | 406 | return $this->collection; |
| 407 | 407 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | */ |
| 424 | 424 | protected function requireValidCollection() : void |
| 425 | 425 | { |
| 426 | - if($this->getCollection()->isValid()) |
|
| 426 | + if ($this->getCollection()->isValid()) |
|
| 427 | 427 | { |
| 428 | 428 | return; |
| 429 | 429 | } |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | */ |
| 447 | 447 | public function getPlaceholderStrings() : array |
| 448 | 448 | { |
| 449 | - if(is_array($this->placeholderStrings)) |
|
| 449 | + if (is_array($this->placeholderStrings)) |
|
| 450 | 450 | { |
| 451 | 451 | return $this->placeholderStrings; |
| 452 | 452 | } |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | |
| 456 | 456 | $this->placeholderStrings = array(); |
| 457 | 457 | |
| 458 | - foreach($placeholders as $placeholder) |
|
| 458 | + foreach ($placeholders as $placeholder) |
|
| 459 | 459 | { |
| 460 | 460 | $this->placeholderStrings[] = $placeholder->getReplacementText(); |
| 461 | 461 | } |
@@ -481,9 +481,9 @@ discard block |
||
| 481 | 481 | { |
| 482 | 482 | $placeholders = $this->getPlaceholders(); |
| 483 | 483 | |
| 484 | - foreach($placeholders as $placeholder) |
|
| 484 | + foreach ($placeholders as $placeholder) |
|
| 485 | 485 | { |
| 486 | - if($placeholder->getID() === $id) |
|
| 486 | + if ($placeholder->getID() === $id) |
|
| 487 | 487 | { |
| 488 | 488 | return $placeholder; |
| 489 | 489 | } |
@@ -510,9 +510,9 @@ discard block |
||
| 510 | 510 | { |
| 511 | 511 | $placeholders = $this->getPlaceholders(); |
| 512 | 512 | |
| 513 | - foreach($placeholders as $placeholder) |
|
| 513 | + foreach ($placeholders as $placeholder) |
|
| 514 | 514 | { |
| 515 | - if($placeholder->getReplacementText() === $string) |
|
| 515 | + if ($placeholder->getReplacementText() === $string) |
|
| 516 | 516 | { |
| 517 | 517 | return $placeholder; |
| 518 | 518 | } |