@@ -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); |
@@ -138,32 +138,32 @@ discard block |
||
138 | 138 | $mail->setBody($bodyText, 'text/plain'); |
139 | 139 | } |
140 | 140 | |
141 | - if( $this->fromAddresses) { |
|
141 | + if ($this->fromAddresses) { |
|
142 | 142 | $mail->setFrom($this->fromAddresses, $this->fromName); |
143 | 143 | $mail->setSender($this->fromAddresses, $this->fromName); |
144 | 144 | } |
145 | - if( $this->toAddresses) { |
|
145 | + if ($this->toAddresses) { |
|
146 | 146 | $mail->setTo($this->toAddresses, $this->toName); |
147 | 147 | } |
148 | - if( $this->bccAddresses) { |
|
148 | + if ($this->bccAddresses) { |
|
149 | 149 | $mail->setBcc($this->bccAddresses, $this->bccName); |
150 | 150 | } |
151 | - if( $this->ccAddresses) { |
|
151 | + if ($this->ccAddresses) { |
|
152 | 152 | $mail->setCc($this->ccAddresses, $this->ccName); |
153 | 153 | } |
154 | - if( $this->replyToAddresses) { |
|
154 | + if ($this->replyToAddresses) { |
|
155 | 155 | $mail->setReplyTo($this->replyToAddresses, $this->replyToName); |
156 | 156 | } |
157 | - if( $this->maxLineLength) { |
|
157 | + if ($this->maxLineLength) { |
|
158 | 158 | $mail->setMaxLineLength($this->maxLineLength); |
159 | 159 | } |
160 | - if( $this->priority) { |
|
160 | + if ($this->priority) { |
|
161 | 161 | $mail->setPriority($this->priority); |
162 | 162 | } |
163 | - if( $this->readReceiptTo) { |
|
163 | + if ($this->readReceiptTo) { |
|
164 | 164 | $mail->setReadReceiptTo($this->readReceiptTo); |
165 | 165 | } |
166 | - if( $this->returnPath) { |
|
166 | + if ($this->returnPath) { |
|
167 | 167 | $mail->setReturnPath($this->returnPath); |
168 | 168 | } |
169 | 169 | |
@@ -308,15 +308,15 @@ discard block |
||
308 | 308 | if (strlen($expand) > 0) { |
309 | 309 | $e = explode('|', $expand); |
310 | 310 | $count = count($e); |
311 | - $pos = []; |
|
312 | - $len = []; |
|
313 | - for ($i = 0;$i < $count;++$i) { |
|
314 | - while (stripos($s, '<'.$e[$i]) > 0) { |
|
315 | - $len[1] = strlen('<'.$e[$i]); |
|
316 | - $pos[1] = stripos($s, '<'.$e[$i]); |
|
317 | - $pos[2] = stripos($s, $e[$i].'>', $pos[1] + $len[1]); |
|
318 | - $len[2] = $pos[2] - $pos[1] + $len[1]; |
|
319 | - $x = substr($s, $pos[1], $len[2]); |
|
311 | + $pos = [ ]; |
|
312 | + $len = [ ]; |
|
313 | + for ($i = 0; $i < $count; ++$i) { |
|
314 | + while (stripos($s, '<'.$e[ $i ]) > 0) { |
|
315 | + $len[ 1 ] = strlen('<'.$e[ $i ]); |
|
316 | + $pos[ 1 ] = stripos($s, '<'.$e[ $i ]); |
|
317 | + $pos[ 2 ] = stripos($s, $e[ $i ].'>', $pos[ 1 ] + $len[ 1 ]); |
|
318 | + $len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ]; |
|
319 | + $x = substr($s, $pos[ 1 ], $len[ 2 ]); |
|
320 | 320 | $s = str_replace($x, '', $s); |
321 | 321 | } |
322 | 322 | } |
@@ -342,13 +342,13 @@ discard block |
||
342 | 342 | */ |
343 | 343 | private function removeElement(string $s, string $openTag, string $closeTag) |
344 | 344 | { |
345 | - $pos = []; |
|
346 | - $len = []; |
|
345 | + $pos = [ ]; |
|
346 | + $len = [ ]; |
|
347 | 347 | while (stripos($s, $openTag) > 0) { |
348 | - $pos[1] = stripos($s, $openTag); |
|
349 | - $pos[2] = stripos($s, $closeTag, $pos[1]); |
|
350 | - $len[1] = $pos[2] - $pos[1] + 1; |
|
351 | - $x = substr($s, $pos[1], $len[1]); |
|
348 | + $pos[ 1 ] = stripos($s, $openTag); |
|
349 | + $pos[ 2 ] = stripos($s, $closeTag, $pos[ 1 ]); |
|
350 | + $len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1; |
|
351 | + $x = substr($s, $pos[ 1 ], $len[ 1 ]); |
|
352 | 352 | $s = str_replace($x, '', $s); |
353 | 353 | } |
354 | 354 | |
@@ -366,9 +366,9 @@ discard block |
||
366 | 366 | private function keepTag(string $s, array $tagToKeep, string $initial, string $finalize):string |
367 | 367 | { |
368 | 368 | $count = count($tagToKeep); |
369 | - for ($i = 0;$i < $count;++$i) { |
|
370 | - $s = str_replace($initial.$tagToKeep[$i], $finalize.$tagToKeep[$i], $s); |
|
371 | - $s = str_replace($initial.'/'.$tagToKeep[$i], $finalize.'/'.$tagToKeep[$i], $s); |
|
369 | + for ($i = 0; $i < $count; ++$i) { |
|
370 | + $s = str_replace($initial.$tagToKeep[ $i ], $finalize.$tagToKeep[ $i ], $s); |
|
371 | + $s = str_replace($initial.'/'.$tagToKeep[ $i ], $finalize.'/'.$tagToKeep[ $i ], $s); |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | return $s; |