Completed
Branch master (518691)
by Lars
02:52
created
lib/classes/Swift/Transport/Esmtp/AuthHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/swiftmailer_generate_mimes_config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@
 block discarded – undo
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 */
Please login to merge, or discard this patch.
lib/classes/Swift/Transport/EsmtpTransport.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
         /** @noinspection PhpUsageOfSilenceOperatorInspection */
249 249
         /** @noinspection UsageOfSilenceOperatorInspection */
250 250
         @uasort($assoc, array($this, '_sortHandlers'));
251
-          $this->_handlers = $assoc;
252
-          $this->_setHandlerParams();
251
+            $this->_handlers = $assoc;
252
+            $this->_setHandlerParams();
253 253
 
254
-          return $this;
254
+            return $this;
255 255
     }
256 256
 
257 257
     /**
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
                     return $this;
326 326
                 }
327 327
 
328
-              return $return;
328
+                return $return;
329 329
             }
330 330
         }
331 331
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function setPort($port)
95 95
     {
96
-        $this->_params['port'] = (int)$port;
96
+        $this->_params['port'] = (int) $port;
97 97
 
98 98
         return $this;
99 99
     }
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function setTimeout($timeout)
119 119
     {
120
-        $this->_params['timeout'] = (int)$timeout;
121
-        $this->_buffer->setParam('timeout', (int)$timeout);
120
+        $this->_params['timeout'] = (int) $timeout;
121
+        $this->_buffer->setParam('timeout', (int) $timeout);
122 122
 
123 123
         return $this;
124 124
     }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
      */
279 279
     public function executeCommand($command, $codes = array(), &$failures = null)
280 280
     {
281
-        $failures = (array)$failures;
281
+        $failures = (array) $failures;
282 282
         $stopSignal = false;
283 283
         $response = null;
284 284
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
             $inArray = in_array(
311 311
                 Swift::strtolowerWithStaticCache($method),
312
-                array_map(array('Swift', 'strtolowerWithStaticCache'), (array)$handler->exposeMixinMethods()),
312
+                array_map(array('Swift', 'strtolowerWithStaticCache'), (array) $handler->exposeMixinMethods()),
313 313
                 true
314 314
             );
315 315
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
             }
330 330
         }
331 331
 
332
-        trigger_error('Call to undefined method ' . $method, E_USER_ERROR);
332
+        trigger_error('Call to undefined method '.$method, E_USER_ERROR);
333 333
     }
334 334
 
335 335
     /** Get the params to initialize the buffer */
@@ -395,10 +395,10 @@  discard block
 block discarded – undo
395 395
 
396 396
         $params = array();
397 397
         foreach ($handlers as $handler) {
398
-            $params = array_merge($params, (array)$handler->getMailParams());
398
+            $params = array_merge($params, (array) $handler->getMailParams());
399 399
         }
400 400
 
401
-        $paramStr = !empty($params) ? ' ' . implode(' ', $params) : '';
401
+        $paramStr = !empty($params) ? ' '.implode(' ', $params) : '';
402 402
         $this->executeCommand(
403 403
             sprintf("MAIL FROM:<%s>%s\r\n", $address, $paramStr), array(250)
404 404
         );
@@ -415,10 +415,10 @@  discard block
 block discarded – undo
415 415
 
416 416
         $params = array();
417 417
         foreach ($handlers as $handler) {
418
-            $params = array_merge($params, (array)$handler->getRcptParams());
418
+            $params = array_merge($params, (array) $handler->getRcptParams());
419 419
         }
420 420
 
421
-        $paramStr = !empty($params) ? ' ' . implode(' ', $params) : '';
421
+        $paramStr = !empty($params) ? ' '.implode(' ', $params) : '';
422 422
         $this->executeCommand(
423 423
             sprintf("RCPT TO:<%s>%s\r\n", $address, $paramStr), array(250, 251, 252)
424 424
         );
Please login to merge, or discard this patch.
lib/classes/Swift/FileSpool.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
     {
38 38
         $this->_path = $path;
39 39
 
40
-      /** @noinspection PhpUsageOfSilenceOperatorInspection */
41
-      if (
40
+        /** @noinspection PhpUsageOfSilenceOperatorInspection */
41
+        if (
42 42
             !file_exists($this->_path)
43 43
             &&
44 44
             !@mkdir($this->_path, 0777, true)
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                         return false;
108 108
                     }
109 109
                     return fclose($fp);
110
-              }
110
+                }
111 111
 
112 112
             /* The file already exists, we try a longer fileName */
113 113
             $fileName .= $this->getRandomString(1);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
     public function queueMessage(Swift_Mime_Message $message)
98 98
     {
99 99
         $ser = serialize($message);
100
-        $fileName = $this->_path . '/' . $this->getRandomString();
100
+        $fileName = $this->_path.'/'.$this->getRandomString();
101 101
         for ($i = 0; $i < $this->_retryLimit; ++$i) {
102 102
             /* We try an exclusive creation of the file. This is an atomic operation, it avoid locking mechanism */
103 103
             /** @noinspection PhpUsageOfSilenceOperatorInspection */
104
-            $fp = @fopen($fileName . '.message', 'xb');
104
+            $fp = @fopen($fileName.'.message', 'xb');
105 105
                 if (false !== $fp) {
106 106
                     if (false === fwrite($fp, $ser)) {
107 107
                         return false;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             }
158 158
         }
159 159
 
160
-        $failedRecipients = (array)$failedRecipients;
160
+        $failedRecipients = (array) $failedRecipients;
161 161
         $count = 0;
162 162
         $time = time();
163 163
         foreach ($directoryIterator as $file) {
@@ -168,13 +168,13 @@  discard block
 block discarded – undo
168 168
             }
169 169
 
170 170
             /* We try a rename, it's an atomic operation, and avoid locking the file */
171
-            if (rename($file, $file . '.sending')) {
171
+            if (rename($file, $file.'.sending')) {
172 172
                 // TODO: -> SECURITY | Perhaps it's possible to exploit the unserialize via: file_get_contents(...)
173
-                $message = unserialize(file_get_contents($file . '.sending'));
173
+                $message = unserialize(file_get_contents($file.'.sending'));
174 174
 
175 175
                 $count += $transport->send($message, $failedRecipients);
176 176
 
177
-                unlink($file . '.sending');
177
+                unlink($file.'.sending');
178 178
             } else {
179 179
                 /* This message has just been catched by another process */
180 180
                 continue;
Please login to merge, or discard this patch.
lib/classes/Swift/Transport/StreamBuffer.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -186,8 +186,8 @@
 block discarded – undo
186 186
             ||
187 187
             feof($this->_out)
188 188
         ) {
189
-          // TODO?
190
-          return;
189
+            // TODO?
190
+            return;
191 191
         }
192 192
 
193 193
         $line = fgets($this->_out);
Please login to merge, or discard this 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/Mime/SimpleMimeEntity.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -641,7 +641,7 @@
 block discarded – undo
641 641
      *
642 642
      * @param string $field
643 643
      *
644
-     * @return null|mixed
644
+     * @return string
645 645
      */
646 646
     protected function _getHeaderFieldModel($field)
647 647
     {
Please login to merge, or discard this 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/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.