Completed
Pull Request — 5.x (#25)
by Lars
23:25 queued 08:33
created
lib/swiftmailer_generate_mimes_config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
     ksort($valid_mime_types);
170 170
 
171 171
     // combine mime types and extensions array
172
-    $output = "$preamble\$swift_mime_types = array(\n    " . implode($valid_mime_types, ",\n    ") . "\n);";
172
+    $output = "$preamble\$swift_mime_types = array(\n    ".implode($valid_mime_types, ",\n    ")."\n);";
173 173
 
174 174
     // write mime_types.php config file
175 175
     @file_put_contents('./mime_types.php', $output);
Please login to merge, or discard this patch.
lib/classes/Swift/FileSpool.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
     public function queueMessage(Swift_Mime_Message $message)
97 97
     {
98 98
         $ser = serialize($message);
99
-        $fileName = $this->_path . '/' . $this->getRandomString(10);
99
+        $fileName = $this->_path.'/'.$this->getRandomString(10);
100 100
         for ($i = 0; $i < $this->_retryLimit; ++$i) {
101 101
             /* We try an exclusive creation of the file. This is an atomic operation, it avoid locking mechanism */
102
-            $fp = @fopen($fileName . '.message', 'x');
102
+            $fp = @fopen($fileName.'.message', 'x');
103 103
             if (false !== $fp) {
104 104
                 if (false === fwrite($fp, $ser)) {
105 105
                     return false;
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             }
157 157
         }
158 158
 
159
-        $failedRecipients = (array)$failedRecipients;
159
+        $failedRecipients = (array) $failedRecipients;
160 160
         $count = 0;
161 161
         $time = time();
162 162
         foreach ($directoryIterator as $file) {
@@ -167,12 +167,12 @@  discard block
 block discarded – undo
167 167
             }
168 168
 
169 169
             /* We try a rename, it's an atomic operation, and avoid locking the file */
170
-            if (rename($file, $file . '.sending')) {
171
-                $message = unserialize(file_get_contents($file . '.sending'));
170
+            if (rename($file, $file.'.sending')) {
171
+                $message = unserialize(file_get_contents($file.'.sending'));
172 172
 
173 173
                 $count += $transport->send($message, $failedRecipients);
174 174
 
175
-                unlink($file . '.sending');
175
+                unlink($file.'.sending');
176 176
             } else {
177 177
                 /* This message has just been catched by another process */
178 178
                 continue;
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         $ret = '';
205 205
         $strlen = strlen($base);
206 206
         for ($i = 0; $i < $count; ++$i) {
207
-            $ret .= $base[((int)mt_rand(0, $strlen - 1))];
207
+            $ret .= $base[((int) mt_rand(0, $strlen - 1))];
208 208
         }
209 209
 
210 210
         return $ret;
Please login to merge, or discard this patch.
lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
306 306
         $host = $this->_host;
307 307
         switch (strtolower($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
 
Please login to merge, or discard this patch.
lib/classes/Swift/StreamFilters/StringReplacementFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
             return false;
48 48
         }
49 49
 
50
-        foreach ((array)$this->_search as $needle) {
50
+        foreach ((array) $this->_search as $needle) {
51 51
             if (
52 52
                 $needle
53 53
                 &&
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/SimpleMimeEntity.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -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() . '_' . md5(getmypid() . mt_rand() . uniqid('', true)) . '_=_';
471
+            $this->_boundary = '_=_swift_v5_'.time().'_'.md5(getmypid().mt_rand().uniqid('', true)).'_=_';
472 472
         }
473 473
 
474 474
         return $this->_boundary;
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
             if ($this->_cache->hasKey($this->_cacheKey, 'body')) {
540 540
                 $body = $this->_cache->getString($this->_cacheKey, 'body');
541 541
             } else {
542
-                $body = "\r\n" . $this->_encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength());
542
+                $body = "\r\n".$this->_encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength());
543 543
                 $this->_cache->setString($this->_cacheKey, 'body', $body, Swift_KeyCache::MODE_WRITE);
544 544
             }
545 545
             $string .= $body;
@@ -547,10 +547,10 @@  discard block
 block discarded – undo
547 547
 
548 548
         if (!empty($this->_immediateChildren)) {
549 549
             foreach ($this->_immediateChildren as $child) {
550
-                $string .= "\r\n\r\n--" . $this->getBoundary() . "\r\n";
550
+                $string .= "\r\n\r\n--".$this->getBoundary()."\r\n";
551 551
                 $string .= $child->toString();
552 552
             }
553
-            $string .= "\r\n\r\n--" . $this->getBoundary() . "--\r\n";
553
+            $string .= "\r\n\r\n--".$this->getBoundary()."--\r\n";
554 554
         }
555 555
 
556 556
         return $string;
@@ -617,10 +617,10 @@  discard block
 block discarded – undo
617 617
 
618 618
         if (!empty($this->_immediateChildren)) {
619 619
             foreach ($this->_immediateChildren as $child) {
620
-                $is->write("\r\n\r\n--" . $this->getBoundary() . "\r\n");
620
+                $is->write("\r\n\r\n--".$this->getBoundary()."\r\n");
621 621
                 $child->toByteStream($is);
622 622
             }
623
-            $is->write("\r\n\r\n--" . $this->getBoundary() . "--\r\n");
623
+            $is->write("\r\n\r\n--".$this->getBoundary()."--\r\n");
624 624
         }
625 625
     }
626 626
 
@@ -751,12 +751,12 @@  discard block
 block discarded – undo
751 751
     {
752 752
         $idLeft = $this->_generateNewCacheKey();
753 753
         $idRight = !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'swift.generated';
754
-        $id = $idLeft . '@' . $idRight;
754
+        $id = $idLeft.'@'.$idRight;
755 755
 
756 756
         try {
757 757
             $this->_assertValidId($id);
758 758
         } catch (Swift_RfcComplianceException $e) {
759
-            $id = $idLeft . '@swift.generated';
759
+            $id = $idLeft.'@swift.generated';
760 760
         }
761 761
 
762 762
         return $id;
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
      */
770 770
     private function _generateNewCacheKey()
771 771
     {
772
-        return md5(getmypid() . '.' . time() . '.' . uniqid(mt_rand(), true));
772
+        return md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true));
773 773
     }
774 774
 
775 775
     private function _readStream(Swift_OutputByteStream $os)
@@ -852,10 +852,10 @@  discard block
 block discarded – undo
852 852
         $lowercaseType = Swift::strtolowerWithStaticCache($child->getContentType());
853 853
 
854 854
         if (isset($filter[$realLevel]) && isset($filter[$realLevel][$lowercaseType])) {
855
-            return (int)$filter[$realLevel][$lowercaseType];
855
+            return (int) $filter[$realLevel][$lowercaseType];
856 856
         }
857 857
 
858
-        return (int)$realLevel;
858
+        return (int) $realLevel;
859 859
     }
860 860
 
861 861
     /**
@@ -949,7 +949,7 @@  discard block
 block discarded – undo
949 949
     private function _assertValidId($id)
950 950
     {
951 951
         if ($this->_emailValidator->isValidWrapper($id) === false) {
952
-            throw new Swift_RfcComplianceException('Invalid ID given <' . $id . '>');
952
+            throw new Swift_RfcComplianceException('Invalid ID given <'.$id.'>');
953 953
         }
954 954
     }
955 955
 
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/Headers/AbstractHeader.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         $phraseStr = $string;
215 215
 
216 216
         // If it's not valid
217
-        if (!preg_match('/^' . self::PHRASE_PATTERN . '$/D', $phraseStr)) {
217
+        if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) {
218 218
 
219 219
             if (preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $phraseStr)) {
220 220
                 // .. but it is just ascii text, try escaping some characters
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
             }
226 226
 
227 227
             // and make it a quoted-string
228
-            $phraseStr = '"' . $phraseStr . '"';
228
+            $phraseStr = '"'.$phraseStr.'"';
229 229
         }
230 230
 
231 231
         return $phraseStr;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     protected function escapeSpecials($token, array $include = array())
243 243
     {
244 244
         foreach (array_merge(array('\\'), $include) as $char) {
245
-            $token = str_replace($char, '\\' . $char, $token);
245
+            $token = str_replace($char, '\\'.$char, $token);
246 246
         }
247 247
 
248 248
         return $token;
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                         $token = substr($token, 1);
275 275
                 }
276 276
 
277
-                $usedLength = strlen($header->getFieldName() . ': ') + strlen($value);
277
+                $usedLength = strlen($header->getFieldName().': ') + strlen($value);
278 278
                 $value .= $this->getTokenAsEncodedWord($token, $usedLength);
279 279
 
280 280
                 $header->setMaxLineLength(74); // Forcefully override (we need to save two chars for quoting)
@@ -349,10 +349,10 @@  discard block
 block discarded – undo
349 349
         $charsetDecl = $this->_charset;
350 350
 
351 351
         if (isset($this->_lang)) {
352
-            $charsetDecl .= '*' . $this->_lang;
352
+            $charsetDecl .= '*'.$this->_lang;
353 353
         }
354 354
 
355
-        $encodingWrapperLength = strlen('=?' . $charsetDecl . '?' . $this->_encoder->getName() . '??=');
355
+        $encodingWrapperLength = strlen('=?'.$charsetDecl.'?'.$this->_encoder->getName().'??=');
356 356
 
357 357
         if ($firstLineOffset >= 75) {
358 358
             // Does this logic need to be here?
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
         if (Swift::strtolowerWithStaticCache($this->_charset) !== 'iso-2022-jp') {
369 369
             // special encoding for iso-2022-jp using mb_encode_mimeheader
370 370
             foreach ($encodedTextLines as $lineNum => $line) {
371
-                $encodedTextLines[$lineNum] = '=?' . $charsetDecl . '?' . $this->_encoder->getName() . '?' . $line . '?=';
371
+                $encodedTextLines[$lineNum] = '=?'.$charsetDecl.'?'.$this->_encoder->getName().'?'.$line.'?=';
372 372
             }
373 373
         }
374 374
 
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
     {
458 458
         $lineCount = 0;
459 459
         $headerLines = array();
460
-        $headerLines[] = $this->_name . ': ';
460
+        $headerLines[] = $this->_name.': ';
461 461
         $currentLine = &$headerLines[$lineCount++];
462 462
 
463 463
         // Build all tokens back into compliant header
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
                     (
473 473
                         $i > 0
474 474
                         &&
475
-                        strlen($currentLine . $token) > $this->_lineLength
475
+                        strlen($currentLine.$token) > $this->_lineLength
476 476
                     )
477 477
                 )
478 478
             ) {
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
         }
488 488
 
489 489
         // Implode with FWS (RFC 2822, 2.2.3)
490
-        return implode("\r\n", $headerLines) . "\r\n";
490
+        return implode("\r\n", $headerLines)."\r\n";
491 491
     }
492 492
 
493 493
     /**
Please login to merge, or discard this patch.