@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function setNameAddresses($mailboxes) |
| 111 | 111 | { |
| 112 | - $this->_mailboxes = $this->normalizeMailboxes((array)$mailboxes); |
|
| 112 | + $this->_mailboxes = $this->normalizeMailboxes((array) $mailboxes); |
|
| 113 | 113 | $this->setCachedValue(null); //Clear any cached value |
| 114 | 114 | } |
| 115 | 115 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public function setAddresses($addresses) |
| 196 | 196 | { |
| 197 | - $this->setNameAddresses(array_values((array)$addresses)); |
|
| 197 | + $this->setNameAddresses(array_values((array) $addresses)); |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | /** |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | public function removeAddresses($addresses) |
| 218 | 218 | { |
| 219 | 219 | $this->setCachedValue(null); |
| 220 | - foreach ((array)$addresses as $address) { |
|
| 220 | + foreach ((array) $addresses as $address) { |
|
| 221 | 221 | unset($this->_mailboxes[$address]); |
| 222 | 222 | } |
| 223 | 223 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | $mailboxStr = $email; |
| 338 | 338 | if ($name) { |
| 339 | 339 | $nameStr = $this->createDisplayNameString($name, 0 === count($strings)); |
| 340 | - $mailboxStr = $nameStr . ' <' . $mailboxStr . '>'; |
|
| 340 | + $mailboxStr = $nameStr.' <'.$mailboxStr.'>'; |
|
| 341 | 341 | } |
| 342 | 342 | $strings[] = $mailboxStr; |
| 343 | 343 | } |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | private function _assertValidAddress($address) |
| 356 | 356 | { |
| 357 | 357 | if ($this->_emailValidator->isValidWrapper($address) === false) { |
| 358 | - throw new Swift_RfcComplianceException('Address in mailbox given [' . $address . '] does not comply with RFC 2822, 3.6.2.'); |
|
| 358 | + throw new Swift_RfcComplianceException('Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.'); |
|
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | } |
@@ -203,7 +203,7 @@ |
||
| 203 | 203 | $to = $start; |
| 204 | 204 | for (; $this->_currentPos < $end; ++$this->_currentPos) { |
| 205 | 205 | if (isset($this->_map['i'], $this->_map['i'][$this->_currentPos])) { |
| 206 | - $ret .= substr($this->_datas, $start, $to - $start) . '?'; |
|
| 206 | + $ret .= substr($this->_datas, $start, $to - $start).'?'; |
|
| 207 | 207 | $start = $this->_map['p'][$this->_currentPos]; |
| 208 | 208 | } else { |
| 209 | 209 | $to = $this->_map['p'][$this->_currentPos]; |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | throw new Swift_TransportException( |
| 188 | - 'Failed to authenticate on SMTP server with username "' . |
|
| 189 | - $this->_username . '" using ' . $count . ' possible authenticators' |
|
| 188 | + 'Failed to authenticate on SMTP server with username "'. |
|
| 189 | + $this->_username.'" using '.$count.' possible authenticators' |
|
| 190 | 190 | ); |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -263,6 +263,6 @@ discard block |
||
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | - throw new Swift_TransportException('Auth mode ' . $mode . ' is invalid'); |
|
| 266 | + throw new Swift_TransportException('Auth mode '.$mode.' is invalid'); |
|
| 267 | 267 | } |
| 268 | 268 | } |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | if (!$line) { |
| 184 | 184 | $metas = stream_get_meta_data($this->_out); |
| 185 | 185 | if ($metas['timed_out']) { |
| 186 | - throw new Swift_IoException('Connection to ' . $this->_getReadConnectionDescription() . ' Timed Out'); |
|
| 186 | + throw new Swift_IoException('Connection to '.$this->_getReadConnectionDescription().' Timed Out'); |
|
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $metas = stream_get_meta_data($this->_out); |
| 213 | 213 | if ($metas['timed_out']) { |
| 214 | 214 | throw new Swift_IoException( |
| 215 | - 'Connection to ' . $this->_getReadConnectionDescription() . ' Timed Out' |
|
| 215 | + 'Connection to '.$this->_getReadConnectionDescription().' Timed Out' |
|
| 216 | 216 | ); |
| 217 | 217 | } |
| 218 | 218 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | $bytesWritten = fwrite($this->_in, substr($bytes, $totalBytesWritten)); |
| 254 | 254 | if (false === $bytesWritten || 0 === $bytesWritten) { |
| 255 | 255 | throw new Swift_IoException( |
| 256 | - 'Connection to ' . $this->_getReadConnectionDescription() . ' has gone away' |
|
| 256 | + 'Connection to '.$this->_getReadConnectionDescription().' has gone away' |
|
| 257 | 257 | ); |
| 258 | 258 | } |
| 259 | 259 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | $host = $this->_params['host']; |
| 281 | 281 | if (!empty($this->_params['protocol'])) { |
| 282 | - $host = $this->_params['protocol'] . '://' . $host; |
|
| 282 | + $host = $this->_params['protocol'].'://'.$host; |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | $timeout = 15; |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | if (!empty($this->_params['sourceIp'])) { |
| 291 | - $options['socket']['bindto'] = $this->_params['sourceIp'] . ':0'; |
|
| 291 | + $options['socket']['bindto'] = $this->_params['sourceIp'].':0'; |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | if (!empty($this->_params['verifySsl'])) { |
@@ -301,10 +301,10 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | $streamContext = stream_context_create($options); |
| 303 | 303 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 304 | - $this->_stream = @stream_socket_client($host . ':' . $this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext); |
|
| 304 | + $this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext); |
|
| 305 | 305 | |
| 306 | 306 | if (false === $this->_stream) { |
| 307 | - throw new Swift_TransportException('Connection could not be established with host ' . $this->_params['host'] . ' [' . $errstr . ' #' . $errno . ']'); |
|
| 307 | + throw new Swift_TransportException('Connection could not be established with host '.$this->_params['host'].' ['.$errstr.' #'.$errno.']'); |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | if (!empty($this->_params['blocking'])) { |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | |
| 336 | 336 | $err = stream_get_contents($pipes[2]); |
| 337 | 337 | if ($err) { |
| 338 | - throw new Swift_TransportException('Process could not be started [' . $err . ']'); |
|
| 338 | + throw new Swift_TransportException('Process could not be started ['.$err.']'); |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | $this->_in = &$pipes[0]; |
@@ -346,16 +346,16 @@ discard block |
||
| 346 | 346 | { |
| 347 | 347 | switch ($this->_params['type']) { |
| 348 | 348 | case self::TYPE_PROCESS: |
| 349 | - return 'Process ' . $this->_params['command']; |
|
| 349 | + return 'Process '.$this->_params['command']; |
|
| 350 | 350 | break; |
| 351 | 351 | |
| 352 | 352 | case self::TYPE_SOCKET: |
| 353 | 353 | default: |
| 354 | 354 | $host = $this->_params['host']; |
| 355 | 355 | if (!empty($this->_params['protocol'])) { |
| 356 | - $host = $this->_params['protocol'] . '://' . $host; |
|
| 356 | + $host = $this->_params['protocol'].'://'.$host; |
|
| 357 | 357 | } |
| 358 | - $host .= ':' . $this->_params['port']; |
|
| 358 | + $host .= ':'.$this->_params['port']; |
|
| 359 | 359 | |
| 360 | 360 | return $host; |
| 361 | 361 | break; |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | ksort($valid_mime_types); |
| 182 | 182 | |
| 183 | 183 | // combine mime types and extensions array |
| 184 | - $output = "$preamble\$swift_mime_types = array(\n " . implode($valid_mime_types, ",\n ") . "\n);"; |
|
| 184 | + $output = "$preamble\$swift_mime_types = array(\n ".implode($valid_mime_types, ",\n ")."\n);"; |
|
| 185 | 185 | |
| 186 | 186 | // write mime_types.php config file |
| 187 | 187 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | public function getId() |
| 243 | 243 | { |
| 244 | - $tmp = (array)$this->_getHeaderFieldModel($this->_getIdField()); |
|
| 244 | + $tmp = (array) $this->_getHeaderFieldModel($this->_getIdField()); |
|
| 245 | 245 | |
| 246 | 246 | return $this->_headers->has($this->_getIdField()) ? current($tmp) : $this->_id; |
| 247 | 247 | } |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | public function getBoundary() |
| 469 | 469 | { |
| 470 | 470 | if (!isset($this->_boundary)) { |
| 471 | - $this->_boundary = '_=_swift_v5_' . time() . '_' . md5(getmypid() . mt_rand() . uniqid('', true)) . '_=_'; |
|
| 471 | + $this->_boundary = '_=_swift_v5_'.time().'_'.md5(getmypid().mt_rand().uniqid('', true)).'_=_'; |
|
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | return $this->_boundary; |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | if ($this->_cache->hasKey($this->_cacheKey, 'body')) { |
| 544 | 544 | $body = $this->_cache->getString($this->_cacheKey, 'body'); |
| 545 | 545 | } else { |
| 546 | - $body = "\r\n" . $this->_encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength()); |
|
| 546 | + $body = "\r\n".$this->_encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength()); |
|
| 547 | 547 | $this->_cache->setString($this->_cacheKey, 'body', $body, Swift_KeyCache::MODE_WRITE); |
| 548 | 548 | } |
| 549 | 549 | $string .= $body; |
@@ -551,10 +551,10 @@ discard block |
||
| 551 | 551 | |
| 552 | 552 | if (!empty($this->_immediateChildren)) { |
| 553 | 553 | foreach ($this->_immediateChildren as $child) { |
| 554 | - $string .= "\r\n\r\n--" . $this->getBoundary() . "\r\n"; |
|
| 554 | + $string .= "\r\n\r\n--".$this->getBoundary()."\r\n"; |
|
| 555 | 555 | $string .= $child->toString(); |
| 556 | 556 | } |
| 557 | - $string .= "\r\n\r\n--" . $this->getBoundary() . "--\r\n"; |
|
| 557 | + $string .= "\r\n\r\n--".$this->getBoundary()."--\r\n"; |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | return $string; |
@@ -621,10 +621,10 @@ discard block |
||
| 621 | 621 | |
| 622 | 622 | if (!empty($this->_immediateChildren)) { |
| 623 | 623 | foreach ($this->_immediateChildren as $child) { |
| 624 | - $is->write("\r\n\r\n--" . $this->getBoundary() . "\r\n"); |
|
| 624 | + $is->write("\r\n\r\n--".$this->getBoundary()."\r\n"); |
|
| 625 | 625 | $child->toByteStream($is); |
| 626 | 626 | } |
| 627 | - $is->write("\r\n\r\n--" . $this->getBoundary() . "--\r\n"); |
|
| 627 | + $is->write("\r\n\r\n--".$this->getBoundary()."--\r\n"); |
|
| 628 | 628 | } |
| 629 | 629 | } |
| 630 | 630 | |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | */ |
| 754 | 754 | private function _generateNewCacheKey() |
| 755 | 755 | { |
| 756 | - return md5(getmypid() . '.' . time() . '.' . uniqid(mt_rand(), true)); |
|
| 756 | + return md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true)); |
|
| 757 | 757 | } |
| 758 | 758 | |
| 759 | 759 | /** |
@@ -849,10 +849,10 @@ discard block |
||
| 849 | 849 | $lowercaseType = Swift::strtolowerWithStaticCache($child->getContentType()); |
| 850 | 850 | |
| 851 | 851 | if (isset($filter[$realLevel], $filter[$realLevel][$lowercaseType])) { |
| 852 | - return (int)$filter[$realLevel][$lowercaseType]; |
|
| 852 | + return (int) $filter[$realLevel][$lowercaseType]; |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | - return (int)$realLevel; |
|
| 855 | + return (int) $realLevel; |
|
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | /** |
@@ -903,8 +903,7 @@ discard block |
||
| 903 | 903 | foreach ($this->_immediateChildren as $child) { |
| 904 | 904 | $type = $child->getContentType(); |
| 905 | 905 | $level = array_key_exists($type, $this->_alternativePartOrder) ? |
| 906 | - $this->_alternativePartOrder[$type] : |
|
| 907 | - max($this->_alternativePartOrder) + 1; |
|
| 906 | + $this->_alternativePartOrder[$type] : max($this->_alternativePartOrder) + 1; |
|
| 908 | 907 | |
| 909 | 908 | if (empty($sorted[$level])) { |
| 910 | 909 | $sorted[$level] = array(); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | { |
| 210 | 210 | $this->_privateKey = $privateKey; |
| 211 | 211 | $this->_domainName = $domainName; |
| 212 | - $this->_signerIdentity = '@' . $domainName; |
|
| 212 | + $this->_signerIdentity = '@'.$domainName; |
|
| 213 | 213 | $this->_selector = $selector; |
| 214 | 214 | $this->_passphrase = $passphrase; |
| 215 | 215 | |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | ); |
| 581 | 581 | |
| 582 | 582 | if ($this->_bodyCanon != 'simple') { |
| 583 | - $params['c'] = $this->_headerCanon . '/' . $this->_bodyCanon; |
|
| 583 | + $params['c'] = $this->_headerCanon.'/'.$this->_bodyCanon; |
|
| 584 | 584 | } elseif ($this->_headerCanon != 'simple') { |
| 585 | 585 | $params['c'] = $this->_headerCanon; |
| 586 | 586 | } |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | |
| 615 | 615 | $string = ''; |
| 616 | 616 | foreach ($params as $k => $v) { |
| 617 | - $string .= $k . '=' . $v . '; '; |
|
| 617 | + $string .= $k.'='.$v.'; '; |
|
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | $string = trim($string); |
@@ -623,14 +623,14 @@ discard block |
||
| 623 | 623 | // Add the last DKIM-Signature |
| 624 | 624 | $tmp = $headers->getAll('DKIM-Signature'); |
| 625 | 625 | $this->_dkimHeader = end($tmp); |
| 626 | - $this->_addHeader(trim($this->_dkimHeader->toString()) . "\r\n b=", true); |
|
| 626 | + $this->_addHeader(trim($this->_dkimHeader->toString())."\r\n b=", true); |
|
| 627 | 627 | $this->_endOfHeaders(); |
| 628 | 628 | |
| 629 | 629 | if ($this->_debugHeaders) { |
| 630 | 630 | $headers->addTextHeader('X-DebugHash', base64_encode($this->_headerHash)); |
| 631 | 631 | } |
| 632 | 632 | |
| 633 | - $this->_dkimHeader->setValue($string . ' b=' . trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '))); |
|
| 633 | + $this->_dkimHeader->setValue($string.' b='.trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '))); |
|
| 634 | 634 | |
| 635 | 635 | return $this; |
| 636 | 636 | } |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | $name = Swift::strtolowerWithStaticCache(trim($exploded[0])); |
| 649 | 649 | $value = str_replace("\r\n", '', $exploded[1]); |
| 650 | 650 | $value = preg_replace("/[ \t][ \t]+/", ' ', $value); |
| 651 | - $header = $name . ':' . trim($value) . ($is_sig ? '' : "\r\n"); |
|
| 651 | + $header = $name.':'.trim($value).($is_sig ? '' : "\r\n"); |
|
| 652 | 652 | case 'simple': |
| 653 | 653 | // Nothing to do |
| 654 | 654 | } |
@@ -780,13 +780,13 @@ discard block |
||
| 780 | 780 | |
| 781 | 781 | $pkeyId = openssl_get_privatekey($this->_privateKey, $this->_passphrase); |
| 782 | 782 | if (!$pkeyId) { |
| 783 | - throw new Swift_SwiftException('Unable to load DKIM Private Key [' . openssl_error_string() . ']'); |
|
| 783 | + throw new Swift_SwiftException('Unable to load DKIM Private Key ['.openssl_error_string().']'); |
|
| 784 | 784 | } |
| 785 | 785 | |
| 786 | 786 | if (openssl_sign($this->_headerCanonData, $signature, $pkeyId, $algorithm)) { |
| 787 | 787 | return $signature; |
| 788 | 788 | } |
| 789 | 789 | |
| 790 | - throw new Swift_SwiftException('Unable to sign DKIM Hash [' . openssl_error_string() . ']'); |
|
| 790 | + throw new Swift_SwiftException('Unable to sign DKIM Hash ['.openssl_error_string().']'); |
|
| 791 | 791 | } |
| 792 | 792 | } |