@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function setPort($port) |
| 93 | 93 | { |
| 94 | - $this->_params['port'] = (int)$port; |
|
| 94 | + $this->_params['port'] = (int) $port; |
|
| 95 | 95 | |
| 96 | 96 | return $this; |
| 97 | 97 | } |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function setTimeout($timeout) |
| 117 | 117 | { |
| 118 | - $this->_params['timeout'] = (int)$timeout; |
|
| 119 | - $this->_buffer->setParam('timeout', (int)$timeout); |
|
| 118 | + $this->_params['timeout'] = (int) $timeout; |
|
| 119 | + $this->_buffer->setParam('timeout', (int) $timeout); |
|
| 120 | 120 | |
| 121 | 121 | return $this; |
| 122 | 122 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | public function executeCommand($command, $codes = array(), &$failures = null) |
| 260 | 260 | { |
| 261 | - $failures = (array)$failures; |
|
| 261 | + $failures = (array) $failures; |
|
| 262 | 262 | $stopSignal = false; |
| 263 | 263 | $response = null; |
| 264 | 264 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | |
| 292 | 292 | $inArray = in_array( |
| 293 | 293 | strtolower($method), |
| 294 | - array_map('strtolower', (array)$handler->exposeMixinMethods()), |
|
| 294 | + array_map('strtolower', (array) $handler->exposeMixinMethods()), |
|
| 295 | 295 | true |
| 296 | 296 | ); |
| 297 | 297 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | - trigger_error('Call to undefined method ' . $method, E_USER_ERROR); |
|
| 313 | + trigger_error('Call to undefined method '.$method, E_USER_ERROR); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** Get the params to initialize the buffer */ |
@@ -376,10 +376,10 @@ discard block |
||
| 376 | 376 | |
| 377 | 377 | $params = array(); |
| 378 | 378 | foreach ($handlers as $handler) { |
| 379 | - $params = array_merge($params, (array)$handler->getMailParams()); |
|
| 379 | + $params = array_merge($params, (array) $handler->getMailParams()); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | - $paramStr = !empty($params) ? ' ' . implode(' ', $params) : ''; |
|
| 382 | + $paramStr = !empty($params) ? ' '.implode(' ', $params) : ''; |
|
| 383 | 383 | $this->executeCommand( |
| 384 | 384 | sprintf("MAIL FROM:<%s>%s\r\n", $address, $paramStr), array(250) |
| 385 | 385 | ); |
@@ -396,10 +396,10 @@ discard block |
||
| 396 | 396 | |
| 397 | 397 | $params = array(); |
| 398 | 398 | foreach ($handlers as $handler) { |
| 399 | - $params = array_merge($params, (array)$handler->getRcptParams()); |
|
| 399 | + $params = array_merge($params, (array) $handler->getRcptParams()); |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | - $paramStr = !empty($params) ? ' ' . implode(' ', $params) : ''; |
|
| 402 | + $paramStr = !empty($params) ? ' '.implode(' ', $params) : ''; |
|
| 403 | 403 | $this->executeCommand( |
| 404 | 404 | sprintf("RCPT TO:<%s>%s\r\n", $address, $paramStr), array(250, 251, 252) |
| 405 | 405 | ); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function send(Swift_Mime_Message $message, &$failedRecipients = null) |
| 106 | 106 | { |
| 107 | - $failedRecipients = (array)$failedRecipients; |
|
| 107 | + $failedRecipients = (array) $failedRecipients; |
|
| 108 | 108 | |
| 109 | 109 | $evt = $this->_eventDispatcher->createSendEvent($this, $message); |
| 110 | 110 | if ($evt) { |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $count = ( |
| 119 | - count((array)$message->getTo()) |
|
| 120 | - + count((array)$message->getCc()) |
|
| 121 | - + count((array)$message->getBcc()) |
|
| 119 | + count((array) $message->getTo()) |
|
| 120 | + + count((array) $message->getCc()) |
|
| 121 | + + count((array) $message->getBcc()) |
|
| 122 | 122 | ); |
| 123 | 123 | |
| 124 | 124 | /* |
@@ -151,10 +151,10 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | // Separate headers from body |
| 153 | 153 | if (false !== $endHeaders = strpos($messageStr, "\r\n\r\n")) { |
| 154 | - $headers = substr($messageStr, 0, $endHeaders) . "\r\n"; // Keep last EOL |
|
| 154 | + $headers = substr($messageStr, 0, $endHeaders)."\r\n"; // Keep last EOL |
|
| 155 | 155 | $body = substr($messageStr, $endHeaders + 4); |
| 156 | 156 | } else { |
| 157 | - $headers = $messageStr . "\r\n"; |
|
| 157 | + $headers = $messageStr."\r\n"; |
|
| 158 | 158 | $body = ''; |
| 159 | 159 | } |
| 160 | 160 | |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | } else { |
| 182 | 182 | $failedRecipients = array_merge( |
| 183 | 183 | $failedRecipients, |
| 184 | - array_keys((array)$message->getTo()), |
|
| 185 | - array_keys((array)$message->getCc()), |
|
| 186 | - array_keys((array)$message->getBcc()) |
|
| 184 | + array_keys((array) $message->getTo()), |
|
| 185 | + array_keys((array) $message->getCc()), |
|
| 186 | + array_keys((array) $message->getBcc()) |
|
| 187 | 187 | ); |
| 188 | 188 | |
| 189 | 189 | if ($evt) { |
@@ -286,10 +286,10 @@ |
||
| 286 | 286 | /** |
| 287 | 287 | * Return php mail extra params to use for invoker->mail. |
| 288 | 288 | * |
| 289 | - * @param $extraParams |
|
| 289 | + * @param string $extraParams |
|
| 290 | 290 | * @param $reversePath |
| 291 | 291 | * |
| 292 | - * @return mixed string|null |
|
| 292 | + * @return string|null string|null |
|
| 293 | 293 | */ |
| 294 | 294 | private function _formatExtraParams($extraParams, $reversePath) |
| 295 | 295 | { |
@@ -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 | ); |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | throw new Swift_TransportException( |
| 185 | - 'Failed to authenticate on SMTP server with username "' . |
|
| 186 | - $this->_username . '" using ' . $count . ' possible authenticators' |
|
| 185 | + 'Failed to authenticate on SMTP server with username "'. |
|
| 186 | + $this->_username.'" using '.$count.' possible authenticators' |
|
| 187 | 187 | ); |
| 188 | 188 | } |
| 189 | 189 | } |
@@ -260,6 +260,6 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | - throw new Swift_TransportException('Auth mode ' . $mode . ' is invalid'); |
|
| 263 | + throw new Swift_TransportException('Auth mode '.$mode.' is invalid'); |
|
| 264 | 264 | } |
| 265 | 265 | } |
@@ -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 | ); |
@@ -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 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | $host = $this->_params['host']; |
| 279 | 279 | if (!empty($this->_params['protocol'])) { |
| 280 | - $host = $this->_params['protocol'] . '://' . $host; |
|
| 280 | + $host = $this->_params['protocol'].'://'.$host; |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | $timeout = 15; |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | if (!empty($this->_params['sourceIp'])) { |
| 289 | - $options['socket']['bindto'] = $this->_params['sourceIp'] . ':0'; |
|
| 289 | + $options['socket']['bindto'] = $this->_params['sourceIp'].':0'; |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | if (isset($this->_params['stream_context_options'])) { |
@@ -294,10 +294,10 @@ discard block |
||
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | $streamContext = stream_context_create($options); |
| 297 | - $this->_stream = @stream_socket_client($host . ':' . $this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext); |
|
| 297 | + $this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext); |
|
| 298 | 298 | |
| 299 | 299 | if (false === $this->_stream) { |
| 300 | - throw new Swift_TransportException('Connection could not be established with host ' . $this->_params['host'] . ' [' . $errstr . ' #' . $errno . ']'); |
|
| 300 | + throw new Swift_TransportException('Connection could not be established with host '.$this->_params['host'].' ['.$errstr.' #'.$errno.']'); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | if (!empty($this->_params['blocking'])) { |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | $err = stream_get_contents($pipes[2]); |
| 330 | 330 | if ($err) { |
| 331 | - throw new Swift_TransportException('Process could not be started [' . $err . ']'); |
|
| 331 | + throw new Swift_TransportException('Process could not be started ['.$err.']'); |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | $this->_in = &$pipes[0]; |
@@ -339,16 +339,16 @@ discard block |
||
| 339 | 339 | { |
| 340 | 340 | switch ($this->_params['type']) { |
| 341 | 341 | case self::TYPE_PROCESS: |
| 342 | - return 'Process ' . $this->_params['command']; |
|
| 342 | + return 'Process '.$this->_params['command']; |
|
| 343 | 343 | break; |
| 344 | 344 | |
| 345 | 345 | case self::TYPE_SOCKET: |
| 346 | 346 | default: |
| 347 | 347 | $host = $this->_params['host']; |
| 348 | 348 | if (!empty($this->_params['protocol'])) { |
| 349 | - $host = $this->_params['protocol'] . '://' . $host; |
|
| 349 | + $host = $this->_params['protocol'].'://'.$host; |
|
| 350 | 350 | } |
| 351 | - $host .= ':' . $this->_params['port']; |
|
| 351 | + $host .= ':'.$this->_params['port']; |
|
| 352 | 352 | |
| 353 | 353 | return $host; |
| 354 | 354 | break; |