@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | { |
| 107 | 107 | if ($lang && $this->_lang !== $lang) { |
| 108 | 108 | $this->clearCachedValue(); |
| 109 | - $this->_lang = (string)$lang; |
|
| 109 | + $this->_lang = (string) $lang; |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | if ($lineLength && $this->_lineLength !== $lineLength) { |
| 166 | 166 | $this->clearCachedValue(); |
| 167 | 167 | |
| 168 | - $this->_lineLength = (int)$lineLength; |
|
| 168 | + $this->_lineLength = (int) $lineLength; |
|
| 169 | 169 | |
| 170 | 170 | return true; |
| 171 | 171 | } |
@@ -231,17 +231,17 @@ discard block |
||
| 231 | 231 | // Treat token as exactly what was given |
| 232 | 232 | $phraseStr = $string; |
| 233 | 233 | // If it's not valid |
| 234 | - if (!preg_match('/^' . self::PHRASE_PATTERN . '$/D', $phraseStr)) { |
|
| 234 | + if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) { |
|
| 235 | 235 | // .. but it is just ascii text, try escaping some characters |
| 236 | 236 | // and make it a quoted-string |
| 237 | 237 | if (preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $phraseStr)) { |
| 238 | 238 | $phraseStr = $this->escapeSpecials($phraseStr, array('"')); |
| 239 | - $phraseStr = '"' . $phraseStr . '"'; |
|
| 239 | + $phraseStr = '"'.$phraseStr.'"'; |
|
| 240 | 240 | } else { |
| 241 | 241 | // ... otherwise it needs encoding |
| 242 | 242 | // Determine space remaining on line if first line |
| 243 | 243 | if ($shorten) { |
| 244 | - $usedLength = strlen($header->getFieldName() . ': '); |
|
| 244 | + $usedLength = strlen($header->getFieldName().': '); |
|
| 245 | 245 | } else { |
| 246 | 246 | $usedLength = 0; |
| 247 | 247 | } |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | protected function escapeSpecials($token, array $include = array()) |
| 264 | 264 | { |
| 265 | 265 | foreach (array_merge(array('\\'), $include) as $char) { |
| 266 | - $token = str_replace($char, '\\' . $char, $token); |
|
| 266 | + $token = str_replace($char, '\\'.$char, $token); |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | return $token; |
@@ -368,10 +368,10 @@ discard block |
||
| 368 | 368 | $charsetDecl = $this->_charset; |
| 369 | 369 | |
| 370 | 370 | if ($this->_lang) { |
| 371 | - $charsetDecl .= '*' . $this->_lang; |
|
| 371 | + $charsetDecl .= '*'.$this->_lang; |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | - $encodingWrapperLength = strlen('=?' . $charsetDecl . '?' . $this->_encoder->getName() . '??='); |
|
| 374 | + $encodingWrapperLength = strlen('=?'.$charsetDecl.'?'.$this->_encoder->getName().'??='); |
|
| 375 | 375 | |
| 376 | 376 | if ($firstLineOffset >= 75) { |
| 377 | 377 | // Does this logic need to be here? |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | if (Swift::strtolowerWithStaticCache($this->_charset) !== 'iso-2022-jp') { |
| 388 | 388 | // special encoding for iso-2022-jp using mb_encode_mimeheader |
| 389 | 389 | foreach ($encodedTextLines as $lineNum => $line) { |
| 390 | - $encodedTextLines[$lineNum] = '=?' . $charsetDecl . '?' . $this->_encoder->getName() . '?' . $line . '?='; |
|
| 390 | + $encodedTextLines[$lineNum] = '=?'.$charsetDecl.'?'.$this->_encoder->getName().'?'.$line.'?='; |
|
| 391 | 391 | } |
| 392 | 392 | } |
| 393 | 393 | |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | { |
| 482 | 482 | $lineCount = 0; |
| 483 | 483 | $headerLines = array(); |
| 484 | - $headerLines[] = $this->_name . ': '; |
|
| 484 | + $headerLines[] = $this->_name.': '; |
|
| 485 | 485 | $currentLine = &$headerLines[$lineCount++]; |
| 486 | 486 | |
| 487 | 487 | // Build all tokens back into compliant header |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | ( |
| 497 | 497 | $i > 0 |
| 498 | 498 | && |
| 499 | - strlen($currentLine . $token) > $this->_lineLength |
|
| 499 | + strlen($currentLine.$token) > $this->_lineLength |
|
| 500 | 500 | ) |
| 501 | 501 | ) |
| 502 | 502 | ) { |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | // Implode with FWS (RFC 2822, 2.2.3) |
| 514 | - return implode("\r\n", $headerLines) . "\r\n"; |
|
| 514 | + return implode("\r\n", $headerLines)."\r\n"; |
|
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | /** |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | if (strpos($path, '?') !== false) { |
| 82 | 82 | $parameter = parse_url($path, PHP_URL_QUERY); |
| 83 | 83 | |
| 84 | - $this->_path = str_replace('?' . $parameter, '', $path); |
|
| 84 | + $this->_path = str_replace('?'.$parameter, '', $path); |
|
| 85 | 85 | } else { |
| 86 | 86 | $this->_path = $path; |
| 87 | 87 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $pointer = @fopen($this->_path, 'rb', false, stream_context_create($opts)); |
| 208 | 208 | |
| 209 | 209 | if (!$pointer) { |
| 210 | - throw new Swift_IoException('Unable to open file for reading [' . $this->_path . ']'); |
|
| 210 | + throw new Swift_IoException('Unable to open file for reading ['.$this->_path.']'); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | $this->_reader = $pointer; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | $pointer = @fopen($this->_path, $this->_mode); |
| 230 | 230 | |
| 231 | 231 | if (!$pointer) { |
| 232 | - throw new Swift_IoException('Unable to open file for writing [' . $this->_path . ']'); |
|
| 232 | + throw new Swift_IoException('Unable to open file for writing ['.$this->_path.']'); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | $this->_writer = $pointer; |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $source = @fopen($this->_path, 'rb'); |
| 301 | 301 | |
| 302 | 302 | if (!$source) { |
| 303 | - throw new Swift_IoException('Unable to open file for copying [' . $this->_path . ']'); |
|
| 303 | + throw new Swift_IoException('Unable to open file for copying ['.$this->_path.']'); |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | fseek($tmpFile, 0, SEEK_SET); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | public function setTimeout($timeout) |
| 141 | 141 | { |
| 142 | - $this->_timeout = (int)$timeout; |
|
| 142 | + $this->_timeout = (int) $timeout; |
|
| 143 | 143 | |
| 144 | 144 | return $this; |
| 145 | 145 | } |
@@ -306,11 +306,11 @@ discard block |
||
| 306 | 306 | $host = $this->_host; |
| 307 | 307 | switch (Swift::strtolowerWithStaticCache($this->_crypto)) { |
| 308 | 308 | case 'ssl': |
| 309 | - $host = 'ssl://' . $host; |
|
| 309 | + $host = 'ssl://'.$host; |
|
| 310 | 310 | break; |
| 311 | 311 | |
| 312 | 312 | case 'tls': |
| 313 | - $host = 'tls://' . $host; |
|
| 313 | + $host = 'tls://'.$host; |
|
| 314 | 314 | break; |
| 315 | 315 | } |
| 316 | 316 | |
@@ -51,23 +51,23 @@ discard block |
||
| 51 | 51 | $prefix = 'Swift_CharacterReader_'; |
| 52 | 52 | |
| 53 | 53 | $singleByte = array( |
| 54 | - 'class' => $prefix . 'GenericFixedWidthReader', |
|
| 54 | + 'class' => $prefix.'GenericFixedWidthReader', |
|
| 55 | 55 | 'constructor' => array(1), |
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | 58 | $doubleByte = array( |
| 59 | - 'class' => $prefix . 'GenericFixedWidthReader', |
|
| 59 | + 'class' => $prefix.'GenericFixedWidthReader', |
|
| 60 | 60 | 'constructor' => array(2), |
| 61 | 61 | ); |
| 62 | 62 | |
| 63 | 63 | $fourBytes = array( |
| 64 | - 'class' => $prefix . 'GenericFixedWidthReader', |
|
| 64 | + 'class' => $prefix.'GenericFixedWidthReader', |
|
| 65 | 65 | 'constructor' => array(4), |
| 66 | 66 | ); |
| 67 | 67 | |
| 68 | 68 | // UTF-8 |
| 69 | 69 | self::$_map['utf-?8'] = array( |
| 70 | - 'class' => $prefix . 'Utf8Reader', |
|
| 70 | + 'class' => $prefix.'Utf8Reader', |
|
| 71 | 71 | 'constructor' => array(), |
| 72 | 72 | ); |
| 73 | 73 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $charset = Swift::strtolowerWithStaticCache(trim($charset)); |
| 107 | 107 | |
| 108 | 108 | foreach (self::$_map as $pattern => $spec) { |
| 109 | - $re = '/^' . $pattern . '$/D'; |
|
| 109 | + $re = '/^'.$pattern.'$/D'; |
|
| 110 | 110 | if (preg_match($re, $charset)) { |
| 111 | 111 | if (!array_key_exists($pattern, self::$_loaded)) { |
| 112 | 112 | $reflector = new ReflectionClass($spec['class']); |
@@ -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 */ |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | return array('DKIM-Signature', 'X-DebugHash'); |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | - return array('DKIM-Signature'); |
|
| 513 | + return array('DKIM-Signature'); |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | /** |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | |
| 592 | 592 | if ($this->_signatureTimestamp === true) { |
| 593 | 593 | |
| 594 | - $params['t'] = time(); |
|
| 594 | + $params['t'] = time(); |
|
| 595 | 595 | if ($this->_signatureExpiration !== false) { |
| 596 | 596 | $params['x'] = $params['t'] + $this->_signatureExpiration; |
| 597 | 597 | } |
@@ -739,8 +739,8 @@ discard block |
||
| 739 | 739 | { |
| 740 | 740 | $len = strlen($string); |
| 741 | 741 | if ($len > ($new_len = ($this->_maxLen - $this->_bodyLen))) { |
| 742 | - /** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
|
| 743 | - $string = substr($string, 0, $new_len); |
|
| 742 | + /** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
|
| 743 | + $string = substr($string, 0, $new_len); |
|
| 744 | 744 | $len = $new_len; |
| 745 | 745 | } |
| 746 | 746 | hash_update($this->_bodyHashHandler, $string); |
@@ -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 | } |