Completed
Branch master (518691)
by Lars
02:52
created
lib/classes/Swift/Transport/StreamBuffer.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         if (!$line) {
195 195
             $metas = stream_get_meta_data($this->_out);
196 196
             if ($metas['timed_out']) {
197
-                throw new Swift_IoException('Connection to ' . $this->_getReadConnectionDescription() . ' Timed Out');
197
+                throw new Swift_IoException('Connection to '.$this->_getReadConnectionDescription().' Timed Out');
198 198
             }
199 199
         }
200 200
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             $metas = stream_get_meta_data($this->_out);
231 231
             if ($metas['timed_out']) {
232 232
                 throw new Swift_IoException(
233
-                    'Connection to ' . $this->_getReadConnectionDescription() . ' Timed Out'
233
+                    'Connection to '.$this->_getReadConnectionDescription().' Timed Out'
234 234
                 );
235 235
             }
236 236
         }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
             $bytesWritten = fwrite($this->_in, substr($bytes, $totalBytesWritten));
279 279
             if (false === $bytesWritten || 0 === $bytesWritten) {
280 280
                 throw new Swift_IoException(
281
-                    'Connection to ' . $this->_getReadConnectionDescription() . ' has gone away'
281
+                    'Connection to '.$this->_getReadConnectionDescription().' has gone away'
282 282
                 );
283 283
             }
284 284
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 
307 307
         $host = $this->_params['host'];
308 308
         if (!empty($this->_params['protocol'])) {
309
-            $host = $this->_params['protocol'] . '://' . $host;
309
+            $host = $this->_params['protocol'].'://'.$host;
310 310
         }
311 311
 
312 312
         $timeout = 15;
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         }
316 316
 
317 317
         if (!empty($this->_params['sourceIp'])) {
318
-            $options['socket']['bindto'] = $this->_params['sourceIp'] . ':0';
318
+            $options['socket']['bindto'] = $this->_params['sourceIp'].':0';
319 319
         }
320 320
 
321 321
         if (!empty($this->_params['verifySsl'])) {
@@ -328,10 +328,10 @@  discard block
 block discarded – undo
328 328
 
329 329
         $streamContext = stream_context_create($options);
330 330
         /** @noinspection PhpUsageOfSilenceOperatorInspection */
331
-        $this->_stream = @stream_socket_client($host . ':' . $this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext);
331
+        $this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext);
332 332
 
333 333
         if (false === $this->_stream) {
334
-            throw new Swift_TransportException('Connection could not be established with host ' . $this->_params['host'] . ' [' . $errstr . ' #' . $errno . ']');
334
+            throw new Swift_TransportException('Connection could not be established with host '.$this->_params['host'].' ['.$errstr.' #'.$errno.']');
335 335
         }
336 336
 
337 337
         if (!empty($this->_params['blocking'])) {
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 
364 364
         $err = stream_get_contents($pipes[2]);
365 365
         if ($err) {
366
-            throw new Swift_TransportException('Process could not be started [' . $err . ']');
366
+            throw new Swift_TransportException('Process could not be started ['.$err.']');
367 367
         }
368 368
 
369 369
         $this->_in = &$pipes[0];
@@ -377,16 +377,16 @@  discard block
 block discarded – undo
377 377
     {
378 378
         switch ($this->_params['type']) {
379 379
             case self::TYPE_PROCESS:
380
-                return 'Process ' . $this->_params['command'];
380
+                return 'Process '.$this->_params['command'];
381 381
                 break;
382 382
 
383 383
             case self::TYPE_SOCKET:
384 384
             default:
385 385
                 $host = $this->_params['host'];
386 386
                 if (!empty($this->_params['protocol'])) {
387
-                    $host = $this->_params['protocol'] . '://' . $host;
387
+                    $host = $this->_params['protocol'].'://'.$host;
388 388
                 }
389
-                $host .= ':' . $this->_params['port'];
389
+                $host .= ':'.$this->_params['port'];
390 390
 
391 391
                 return $host;
392 392
                 break;
Please login to merge, or discard this patch.
lib/classes/Swift/Encoder/Base64Encoder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@
 block discarded – undo
39 39
         $firstLine = '';
40 40
 
41 41
         if (0 != $firstLineOffset) {
42
-            $firstLine = \substr($encodedString, 0, $maxLineLength - $firstLineOffset) . "\r\n";
42
+            $firstLine = \substr($encodedString, 0, $maxLineLength - $firstLineOffset)."\r\n";
43 43
             $encodedString = \substr($encodedString, $maxLineLength - $firstLineOffset);
44 44
         }
45 45
 
46
-        return $firstLine . \trim(\chunk_split($encodedString, $maxLineLength, "\r\n"));
46
+        return $firstLine.\trim(\chunk_split($encodedString, $maxLineLength, "\r\n"));
47 47
     }
48 48
 
49 49
     /**
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/MimePart.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
      */
96 96
     public function getCharset()
97 97
     {
98
-        return (string)$this->_getHeaderParameter('Content-Type', 'charset');
98
+        return (string) $this->_getHeaderParameter('Content-Type', 'charset');
99 99
     }
100 100
 
101 101
     /**
Please login to merge, or discard this patch.
lib/classes/Swift/CharacterStream/NgCharacterStream.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@
 block discarded – undo
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];
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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++];
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/SimpleMimeEntity.php 1 patch
Spacing   +11 added lines, -12 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
468 468
     public function getBoundary()
469 469
     {
470 470
         if (!isset($this->_boundary)) {
471
-            $this->_boundary = '_=_swift_v5_' . time() . '_' . bin2hex(random_bytes(16)) . '_=_';
471
+            $this->_boundary = '_=_swift_v5_'.time().'_'.bin2hex(random_bytes(16)).'_=_';
472 472
         }
473 473
 
474 474
         return $this->_boundary;
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
@@ -846,13 +846,13 @@  discard block
 block discarded – undo
846 846
         }
847 847
 
848 848
         $realLevel = $child->getNestingLevel();
849
-        $lowercaseType = Swift::strtolowerWithStaticCache((string)$child->getContentType());
849
+        $lowercaseType = Swift::strtolowerWithStaticCache((string) $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
 block discarded – undo
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();
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/Headers/MailboxHeader.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/Headers/AbstractHeader.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.