@@ -103,12 +103,12 @@ discard block |
||
| 103 | 103 | * |
| 104 | 104 | * @return \Swift_Message |
| 105 | 105 | */ |
| 106 | - public function renderMail(array $data = []) :\Swift_Message |
|
| 106 | + public function renderMail(array $data = [ ]) :\Swift_Message |
|
| 107 | 107 | { |
| 108 | 108 | $mail = new \Swift_Message(); |
| 109 | 109 | |
| 110 | 110 | $twigEnvironment = clone $this->twigEnvironment; |
| 111 | - $function = new \Twig_SimpleFunction('embedImage', function ($imgPath) use ($mail) { |
|
| 111 | + $function = new \Twig_SimpleFunction('embedImage', function($imgPath) use ($mail) { |
|
| 112 | 112 | return $mail->embed(\Swift_Image::fromPath($imgPath)); |
| 113 | 113 | }); |
| 114 | 114 | $twigEnvironment->addFunction($function); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $i = 0; |
| 142 | - while($i != 10) { |
|
| 142 | + while ($i != 10) { |
|
| 143 | 143 | switch (true) { |
| 144 | 144 | case $this->fromAddresses && $i < 1 : |
| 145 | 145 | $i = 1; |
@@ -324,15 +324,15 @@ discard block |
||
| 324 | 324 | if (strlen($expand) > 0) { |
| 325 | 325 | $e = explode('|', $expand); |
| 326 | 326 | $count = count($e); |
| 327 | - $pos = []; |
|
| 328 | - $len = []; |
|
| 329 | - for ($i = 0;$i < $count;++$i) { |
|
| 330 | - while (stripos($s, '<'.$e[$i]) > 0) { |
|
| 331 | - $len[1] = strlen('<'.$e[$i]); |
|
| 332 | - $pos[1] = stripos($s, '<'.$e[$i]); |
|
| 333 | - $pos[2] = stripos($s, $e[$i].'>', $pos[1] + $len[1]); |
|
| 334 | - $len[2] = $pos[2] - $pos[1] + $len[1]; |
|
| 335 | - $x = substr($s, $pos[1], $len[2]); |
|
| 327 | + $pos = [ ]; |
|
| 328 | + $len = [ ]; |
|
| 329 | + for ($i = 0; $i < $count; ++$i) { |
|
| 330 | + while (stripos($s, '<'.$e[ $i ]) > 0) { |
|
| 331 | + $len[ 1 ] = strlen('<'.$e[ $i ]); |
|
| 332 | + $pos[ 1 ] = stripos($s, '<'.$e[ $i ]); |
|
| 333 | + $pos[ 2 ] = stripos($s, $e[ $i ].'>', $pos[ 1 ] + $len[ 1 ]); |
|
| 334 | + $len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ]; |
|
| 335 | + $x = substr($s, $pos[ 1 ], $len[ 2 ]); |
|
| 336 | 336 | $s = str_replace($x, '', $s); |
| 337 | 337 | } |
| 338 | 338 | } |
@@ -358,13 +358,13 @@ discard block |
||
| 358 | 358 | */ |
| 359 | 359 | private function removeElement(string $s, string $openTag, string $closeTag) |
| 360 | 360 | { |
| 361 | - $pos = []; |
|
| 362 | - $len = []; |
|
| 361 | + $pos = [ ]; |
|
| 362 | + $len = [ ]; |
|
| 363 | 363 | while (stripos($s, $openTag) > 0) { |
| 364 | - $pos[1] = stripos($s, $openTag); |
|
| 365 | - $pos[2] = stripos($s, $closeTag, $pos[1]); |
|
| 366 | - $len[1] = $pos[2] - $pos[1] + 1; |
|
| 367 | - $x = substr($s, $pos[1], $len[1]); |
|
| 364 | + $pos[ 1 ] = stripos($s, $openTag); |
|
| 365 | + $pos[ 2 ] = stripos($s, $closeTag, $pos[ 1 ]); |
|
| 366 | + $len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1; |
|
| 367 | + $x = substr($s, $pos[ 1 ], $len[ 1 ]); |
|
| 368 | 368 | $s = str_replace($x, '', $s); |
| 369 | 369 | } |
| 370 | 370 | |
@@ -382,9 +382,9 @@ discard block |
||
| 382 | 382 | private function keepTag(string $s, array $tagToKeep, string $initial, string $finalize):string |
| 383 | 383 | { |
| 384 | 384 | $count = count($tagToKeep); |
| 385 | - for ($i = 0;$i < $count;++$i) { |
|
| 386 | - $s = str_replace($initial.$tagToKeep[$i], $finalize.$tagToKeep[$i], $s); |
|
| 387 | - $s = str_replace($initial.'/'.$tagToKeep[$i], $finalize.'/'.$tagToKeep[$i], $s); |
|
| 385 | + for ($i = 0; $i < $count; ++$i) { |
|
| 386 | + $s = str_replace($initial.$tagToKeep[ $i ], $finalize.$tagToKeep[ $i ], $s); |
|
| 387 | + $s = str_replace($initial.'/'.$tagToKeep[ $i ], $finalize.'/'.$tagToKeep[ $i ], $s); |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | return $s; |