@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | if ($atEOF) { |
| 47 | 47 | $streamTheseBytes = $base64ReadBufferRemainderBytes; |
| 48 | 48 | } else { |
| 49 | - $streamTheseBytes = $base64ReadBufferRemainderBytes . $readBytes; |
|
| 49 | + $streamTheseBytes = $base64ReadBufferRemainderBytes.$readBytes; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $base64ReadBufferRemainderBytes = null; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $thisMaxLineLength = $maxLineLength - $remainder - $firstLineOffset; |
| 72 | 72 | |
| 73 | 73 | while ($thisMaxLineLength < strlen($encoded)) { |
| 74 | - $encodedTransformed .= substr($encoded, 0, $thisMaxLineLength) . "\r\n"; |
|
| 74 | + $encodedTransformed .= substr($encoded, 0, $thisMaxLineLength)."\r\n"; |
|
| 75 | 75 | $firstLineOffset = 0; |
| 76 | 76 | $encoded = substr($encoded, $thisMaxLineLength); |
| 77 | 77 | $thisMaxLineLength = $maxLineLength; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $leftOver = ''; |
| 73 | 73 | while (false !== $bytes = $os->read(8192)) { |
| 74 | - $toencode = $leftOver . $bytes; |
|
| 74 | + $toencode = $leftOver.$bytes; |
|
| 75 | 75 | |
| 76 | 76 | if ($this->_canonical) { |
| 77 | 77 | $toencode = $this->_canonicalize($toencode); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | if ( |
| 141 | 141 | $currentLine !== '' |
| 142 | 142 | && |
| 143 | - strlen($currentLine . $chunk) > $length |
|
| 143 | + strlen($currentLine.$chunk) > $length |
|
| 144 | 144 | ) { |
| 145 | 145 | $lines[] = ''; |
| 146 | 146 | $currentLine = &$lines[$lineCount++]; |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | public function send(Swift_Mime_Message $message, &$failedRecipients = null) |
| 178 | 178 | { |
| 179 | 179 | $sent = 0; |
| 180 | - $failedRecipients = (array)$failedRecipients; |
|
| 180 | + $failedRecipients = (array) $failedRecipients; |
|
| 181 | 181 | |
| 182 | 182 | $evt = $this->_eventDispatcher->createSendEvent($this, $message); |
| 183 | 183 | if ($evt) { |
@@ -196,10 +196,10 @@ discard block |
||
| 196 | 196 | ); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - $to = (array)$message->getTo(); |
|
| 200 | - $cc = (array)$message->getCc(); |
|
| 199 | + $to = (array) $message->getTo(); |
|
| 200 | + $cc = (array) $message->getCc(); |
|
| 201 | 201 | $tos = array_merge($to, $cc); |
| 202 | - $bcc = (array)$message->getBcc(); |
|
| 202 | + $bcc = (array) $message->getBcc(); |
|
| 203 | 203 | |
| 204 | 204 | $message->setBcc(array()); |
| 205 | 205 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function executeCommand($command, $codes = array(), &$failures = null) |
| 310 | 310 | { |
| 311 | - $failures = (array)$failures; |
|
| 311 | + $failures = (array) $failures; |
|
| 312 | 312 | $seq = $this->_buffer->write($command); |
| 313 | 313 | $response = $this->_getFullResponse($seq); |
| 314 | 314 | |
@@ -461,8 +461,8 @@ discard block |
||
| 461 | 461 | if (!$valid) { |
| 462 | 462 | $this->_throwException( |
| 463 | 463 | new Swift_TransportException( |
| 464 | - 'Expected response code ' . implode('/', $wanted) . ' but got code ' . |
|
| 465 | - '"' . $code . '", with message "' . $response . '"', |
|
| 464 | + 'Expected response code '.implode('/', $wanted).' but got code '. |
|
| 465 | + '"'.$code.'", with message "'.$response.'"', |
|
| 466 | 466 | $code |
| 467 | 467 | ) |
| 468 | 468 | ); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $challenge = $agent->executeCommand("AUTH CRAM-MD5\r\n", array(334)); |
| 41 | 41 | $challenge = base64_decode(substr($challenge, 4)); |
| 42 | 42 | $message = base64_encode( |
| 43 | - $username . ' ' . $this->_getResponse($password, $challenge) |
|
| 43 | + $username.' '.$this->_getResponse($password, $challenge) |
|
| 44 | 44 | ); |
| 45 | 45 | $agent->executeCommand(sprintf("%s\r\n", $message), array(235)); |
| 46 | 46 | |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | $k_ipad = substr($secret, 0, 64) ^ str_repeat(chr(0x36), 64); |
| 74 | 74 | $k_opad = substr($secret, 0, 64) ^ str_repeat(chr(0x5C), 64); |
| 75 | 75 | |
| 76 | - $inner = pack('H32', md5($k_ipad . $challenge)); |
|
| 77 | - $digest = md5($k_opad . $inner); |
|
| 76 | + $inner = pack('H32', md5($k_ipad.$challenge)); |
|
| 77 | + $digest = md5($k_opad.$inner); |
|
| 78 | 78 | |
| 79 | 79 | return $digest; |
| 80 | 80 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | { |
| 49 | 49 | try { |
| 50 | 50 | $param = $this->constructXOAuth2Params($email, $token); |
| 51 | - $agent->executeCommand('AUTH XOAUTH2 ' . $param . "\r\n", array(235)); |
|
| 51 | + $agent->executeCommand('AUTH XOAUTH2 '.$param."\r\n", array(235)); |
|
| 52 | 52 | |
| 53 | 53 | return true; |
| 54 | 54 | } catch (Swift_TransportException $e) { |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | public function authenticate(Swift_Transport_SmtpAgent $agent, $username, $password) |
| 38 | 38 | { |
| 39 | 39 | try { |
| 40 | - $message = base64_encode($username . chr(0) . $username . chr(0) . $password); |
|
| 40 | + $message = base64_encode($username.chr(0).$username.chr(0).$password); |
|
| 41 | 41 | $agent->executeCommand(sprintf("AUTH PLAIN %s\r\n", $message), array(235)); |
| 42 | 42 | |
| 43 | 43 | return true; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function send(Swift_Mime_Message $message, &$failedRecipients = null) |
| 101 | 101 | { |
| 102 | - $failedRecipients = (array)$failedRecipients; |
|
| 102 | + $failedRecipients = (array) $failedRecipients; |
|
| 103 | 103 | $command = $this->getCommand(); |
| 104 | 104 | $buffer = $this->getBuffer(); |
| 105 | 105 | $count = 0; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if (false === strpos($command, ' -f')) { |
| 119 | - $command .= ' -f' . escapeshellarg($this->_getReversePath($message)); |
|
| 119 | + $command .= ' -f'.escapeshellarg($this->_getReversePath($message)); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $buffer->initialize(array_merge($this->_params, array('command' => $command))); |
@@ -127,9 +127,9 @@ discard block |
||
| 127 | 127 | $buffer->setWriteTranslations(array("\r\n" => "\n")); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - $count = count((array)$message->getTo()) |
|
| 131 | - + count((array)$message->getCc()) |
|
| 132 | - + count((array)$message->getBcc()); |
|
| 130 | + $count = count((array) $message->getTo()) |
|
| 131 | + + count((array) $message->getCc()) |
|
| 132 | + + count((array) $message->getBcc()); |
|
| 133 | 133 | |
| 134 | 134 | $message->toByteStream($buffer); |
| 135 | 135 | $buffer->flushBuffers(); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } else { |
| 153 | 153 | $this->_throwException( |
| 154 | 154 | new Swift_TransportException( |
| 155 | - 'Unsupported sendmail command flags [' . $command . ']. ' . |
|
| 155 | + 'Unsupported sendmail command flags ['.$command.']. '. |
|
| 156 | 156 | 'Must be one of "-bs" or "-t" but can include additional flags.' |
| 157 | 157 | ) |
| 158 | 158 | ); |
@@ -95,14 +95,14 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null) |
| 97 | 97 | { |
| 98 | - $this->signCertificate = 'file://' . str_replace('\\', '/', realpath($certificate)); |
|
| 98 | + $this->signCertificate = 'file://'.str_replace('\\', '/', realpath($certificate)); |
|
| 99 | 99 | |
| 100 | 100 | if (null !== $privateKey) { |
| 101 | 101 | if (is_array($privateKey)) { |
| 102 | 102 | $this->signPrivateKey = $privateKey; |
| 103 | - $this->signPrivateKey[0] = 'file://' . str_replace('\\', '/', realpath($privateKey[0])); |
|
| 103 | + $this->signPrivateKey[0] = 'file://'.str_replace('\\', '/', realpath($privateKey[0])); |
|
| 104 | 104 | } else { |
| 105 | - $this->signPrivateKey = 'file://' . str_replace('\\', '/', realpath($privateKey)); |
|
| 105 | + $this->signPrivateKey = 'file://'.str_replace('\\', '/', realpath($privateKey)); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | $this->encryptCert = array(); |
| 132 | 132 | |
| 133 | 133 | foreach ($recipientCerts as $cert) { |
| 134 | - $this->encryptCert[] = 'file://' . str_replace('\\', '/', realpath($cert)); |
|
| 134 | + $this->encryptCert[] = 'file://'.str_replace('\\', '/', realpath($cert)); |
|
| 135 | 135 | } |
| 136 | 136 | } else { |
| 137 | - $this->encryptCert = 'file://' . str_replace('\\', '/', realpath($recipientCerts)); |
|
| 137 | + $this->encryptCert = 'file://'.str_replace('\\', '/', realpath($recipientCerts)); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if (null !== $cipher) { |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | foreach ($headerLines as $headerLine) { |
| 381 | 381 | // Line separated |
| 382 | 382 | if (ctype_space($headerLines[0]) || false === strpos($headerLine, ':')) { |
| 383 | - $headers[$currentHeaderName] .= ' ' . trim($headerLine); |
|
| 383 | + $headers[$currentHeaderName] .= ' '.trim($headerLine); |
|
| 384 | 384 | continue; |
| 385 | 385 | } |
| 386 | 386 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | $this->_privateKey = $privateKey; |
| 203 | 203 | $this->_domainName = $domainName; |
| 204 | - $this->_signerIdentity = '@' . $domainName; |
|
| 204 | + $this->_signerIdentity = '@'.$domainName; |
|
| 205 | 205 | $this->_selector = $selector; |
| 206 | 206 | } |
| 207 | 207 | |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | // Prepare the DKIM-Signature |
| 550 | 550 | $params = array('v' => '1', 'a' => $this->_hashAlgorithm, 'bh' => base64_encode($this->_bodyHash), 'd' => $this->_domainName, 'h' => implode(': ', $this->_signedHeaders), 'i' => $this->_signerIdentity, 's' => $this->_selector); |
| 551 | 551 | if ($this->_bodyCanon != 'simple') { |
| 552 | - $params['c'] = $this->_headerCanon . '/' . $this->_bodyCanon; |
|
| 552 | + $params['c'] = $this->_headerCanon.'/'.$this->_bodyCanon; |
|
| 553 | 553 | } elseif ($this->_headerCanon != 'simple') { |
| 554 | 554 | $params['c'] = $this->_headerCanon; |
| 555 | 555 | } |
@@ -574,19 +574,19 @@ discard block |
||
| 574 | 574 | } |
| 575 | 575 | $string = ''; |
| 576 | 576 | foreach ($params as $k => $v) { |
| 577 | - $string .= $k . '=' . $v . '; '; |
|
| 577 | + $string .= $k.'='.$v.'; '; |
|
| 578 | 578 | } |
| 579 | 579 | $string = trim($string); |
| 580 | 580 | $headers->addTextHeader('DKIM-Signature', $string); |
| 581 | 581 | // Add the last DKIM-Signature |
| 582 | 582 | $tmp = $headers->getAll('DKIM-Signature'); |
| 583 | 583 | $this->_dkimHeader = end($tmp); |
| 584 | - $this->_addHeader(trim($this->_dkimHeader->toString()) . "\r\n b=", true); |
|
| 584 | + $this->_addHeader(trim($this->_dkimHeader->toString())."\r\n b=", true); |
|
| 585 | 585 | $this->_endOfHeaders(); |
| 586 | 586 | if ($this->_debugHeaders) { |
| 587 | 587 | $headers->addTextHeader('X-DebugHash', base64_encode($this->_headerHash)); |
| 588 | 588 | } |
| 589 | - $this->_dkimHeader->setValue($string . ' b=' . trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '))); |
|
| 589 | + $this->_dkimHeader->setValue($string.' b='.trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '))); |
|
| 590 | 590 | |
| 591 | 591 | return $this; |
| 592 | 592 | } |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | $name = Swift::strtolowerWithStaticCache(trim($exploded[0])); |
| 603 | 603 | $value = str_replace("\r\n", '', $exploded[1]); |
| 604 | 604 | $value = preg_replace("/[ \t][ \t]+/", ' ', $value); |
| 605 | - $header = $name . ':' . trim($value) . ($is_sig ? '' : "\r\n"); |
|
| 605 | + $header = $name.':'.trim($value).($is_sig ? '' : "\r\n"); |
|
| 606 | 606 | case 'simple': |
| 607 | 607 | // Nothing to do |
| 608 | 608 | } |
@@ -723,11 +723,11 @@ discard block |
||
| 723 | 723 | } |
| 724 | 724 | $pkeyId = openssl_get_privatekey($this->_privateKey); |
| 725 | 725 | if (!$pkeyId) { |
| 726 | - throw new Swift_SwiftException('Unable to load DKIM Private Key [' . openssl_error_string() . ']'); |
|
| 726 | + throw new Swift_SwiftException('Unable to load DKIM Private Key ['.openssl_error_string().']'); |
|
| 727 | 727 | } |
| 728 | 728 | if (openssl_sign($this->_headerCanonData, $signature, $pkeyId, $algorithm)) { |
| 729 | 729 | return $signature; |
| 730 | 730 | } |
| 731 | - throw new Swift_SwiftException('Unable to sign DKIM Hash [' . openssl_error_string() . ']'); |
|
| 731 | + throw new Swift_SwiftException('Unable to sign DKIM Hash ['.openssl_error_string().']'); |
|
| 732 | 732 | } |
| 733 | 733 | } |