Completed
Push — 5.x ( 4bb56c...2a7c65 )
by Lars
06:29
created
lib/classes/Swift/Mime/Headers/DateHeader.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
      *
71 71
      * This method returns a UNIX timestamp.
72 72
      *
73
-     * @return mixed
73
+     * @return integer|null
74 74
      */
75 75
     public function getFieldBodyModel()
76 76
     {
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/Headers/MailboxHeader.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@
 block discarded – undo
202 202
      *
203 203
      * @see getNameAddresses()
204 204
      *
205
-     * @return string[]
205
+     * @return integer[]
206 206
      */
207 207
     public function getAddresses()
208 208
     {
Please login to merge, or discard this 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/Attachment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -167,6 +167,6 @@
 block discarded – undo
167 167
         }
168 168
         $extension = Swift::strtolowerWithStaticCache($extension);
169 169
 
170
-        return (string)$extension;
170
+        return (string) $extension;
171 171
     }
172 172
 }
Please login to merge, or discard this patch.
lib/classes/Swift/Transport/MailTransport.php 3 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function send(Swift_Mime_Message $message, &$failedRecipients = null)
132 132
     {
133
-        $failedRecipients = (array)$failedRecipients;
133
+        $failedRecipients = (array) $failedRecipients;
134 134
 
135 135
         $evt = $this->_eventDispatcher->createSendEvent($this, $message);
136 136
         if ($evt) {
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
         }
143 143
 
144 144
         $count = (
145
-            count((array)$message->getTo())
146
-            + count((array)$message->getCc())
147
-            + count((array)$message->getBcc())
145
+            count((array) $message->getTo())
146
+            + count((array) $message->getCc())
147
+            + count((array) $message->getBcc())
148 148
         );
149 149
 
150 150
         /*
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 
178 178
         // Separate headers from body
179 179
         if (false !== $endHeaders = strpos($messageStr, "\r\n\r\n")) {
180
-            $headers = substr($messageStr, 0, $endHeaders) . "\r\n"; // Keep last EOL
180
+            $headers = substr($messageStr, 0, $endHeaders)."\r\n"; // Keep last EOL
181 181
             $body = substr($messageStr, $endHeaders + 4);
182 182
         } else {
183
-            $headers = $messageStr . "\r\n";
183
+            $headers = $messageStr."\r\n";
184 184
             $body = '';
185 185
         }
186 186
 
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
         } else {
208 208
             $failedRecipients = array_merge(
209 209
                 $failedRecipients,
210
-                array_keys((array)$message->getTo()),
211
-                array_keys((array)$message->getCc()),
212
-                array_keys((array)$message->getBcc())
210
+                array_keys((array) $message->getTo()),
211
+                array_keys((array) $message->getCc()),
212
+                array_keys((array) $message->getBcc())
213 213
             );
214 214
 
215 215
             if ($evt) {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             $count = 0;
222 222
         }
223 223
 
224
-        $message->generateId();  // Make sure a new Message ID is used
224
+        $message->generateId(); // Make sure a new Message ID is used
225 225
 
226 226
         return $count;
227 227
     }
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@
 block discarded – undo
147 147
         $messageStr = $message->toString();
148 148
 
149 149
         if ($toHeader) {
150
-          $message->getHeaders()->set($toHeader);
150
+            $message->getHeaders()->set($toHeader);
151 151
         }
152 152
         $message->getHeaders()->set($subjectHeader);
153 153
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@
 block discarded – undo
262 262
      *
263 263
      * @param Swift_Mime_Message $message
264 264
      *
265
-     * @return mixed|null|string
265
+     * @return string|null
266 266
      */
267 267
     private function _getReversePath(Swift_Mime_Message $message)
268 268
     {
Please login to merge, or discard this patch.
lib/classes/Swift/Encoder/QpEncoder.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -260,7 +260,7 @@
 block discarded – undo
260 260
             }
261 261
 
262 262
             if ($tmpRet !== '=00') {
263
-              $ret .= $tmpRet;
263
+                $ret .= $tmpRet;
264 264
             }
265 265
         }
266 266
 
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|string[]|string
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() . '_' . 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;
@@ -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
 
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
      */
754 754
     private function _generateNewCacheKey()
755 755
     {
756
-        return md5(getmypid() . '.' . time() . '.' . uniqid(mt_rand(), true));
756
+        return md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true));
757 757
     }
758 758
 
759 759
     /**
@@ -849,10 +849,10 @@  discard block
 block discarded – undo
849 849
         $lowercaseType = Swift::strtolowerWithStaticCache($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/SimpleMessage.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
             $address = array($address => $name);
159 159
         }
160 160
 
161
-        if (!$this->_setHeaderFieldModel('Sender', (array)$address)) {
162
-            $this->getHeaders()->addMailboxHeader('Sender', (array)$address);
161
+        if (!$this->_setHeaderFieldModel('Sender', (array) $address)) {
162
+            $this->getHeaders()->addMailboxHeader('Sender', (array) $address);
163 163
         }
164 164
 
165 165
         return $this;
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
             $addresses = array($addresses => $name);
213 213
         }
214 214
 
215
-        if (!$this->_setHeaderFieldModel('From', (array)$addresses)) {
216
-            $this->getHeaders()->addMailboxHeader('From', (array)$addresses);
215
+        if (!$this->_setHeaderFieldModel('From', (array) $addresses)) {
216
+            $this->getHeaders()->addMailboxHeader('From', (array) $addresses);
217 217
         }
218 218
 
219 219
         return $this;
@@ -266,8 +266,8 @@  discard block
 block discarded – undo
266 266
             $addresses = array($addresses => $name);
267 267
         }
268 268
 
269
-        if (!$this->_setHeaderFieldModel('Reply-To', (array)$addresses)) {
270
-            $this->getHeaders()->addMailboxHeader('Reply-To', (array)$addresses);
269
+        if (!$this->_setHeaderFieldModel('Reply-To', (array) $addresses)) {
270
+            $this->getHeaders()->addMailboxHeader('Reply-To', (array) $addresses);
271 271
         }
272 272
 
273 273
         return $this;
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
             $addresses = array($addresses => $name);
322 322
         }
323 323
 
324
-        if (!$this->_setHeaderFieldModel('To', (array)$addresses)) {
325
-            $this->getHeaders()->addMailboxHeader('To', (array)$addresses);
324
+        if (!$this->_setHeaderFieldModel('To', (array) $addresses)) {
325
+            $this->getHeaders()->addMailboxHeader('To', (array) $addresses);
326 326
         }
327 327
 
328 328
         return $this;
@@ -373,8 +373,8 @@  discard block
 block discarded – undo
373 373
             $addresses = array($addresses => $name);
374 374
         }
375 375
 
376
-        if (!$this->_setHeaderFieldModel('Cc', (array)$addresses)) {
377
-            $this->getHeaders()->addMailboxHeader('Cc', (array)$addresses);
376
+        if (!$this->_setHeaderFieldModel('Cc', (array) $addresses)) {
377
+            $this->getHeaders()->addMailboxHeader('Cc', (array) $addresses);
378 378
         }
379 379
 
380 380
         return $this;
@@ -425,8 +425,8 @@  discard block
 block discarded – undo
425 425
             $addresses = array($addresses => $name);
426 426
         }
427 427
 
428
-        if (!$this->_setHeaderFieldModel('Bcc', (array)$addresses)) {
429
-            $this->getHeaders()->addMailboxHeader('Bcc', (array)$addresses);
428
+        if (!$this->_setHeaderFieldModel('Bcc', (array) $addresses)) {
429
+            $this->getHeaders()->addMailboxHeader('Bcc', (array) $addresses);
430 430
         }
431 431
 
432 432
         return $this;
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
     {
565 565
         $this->attach($entity);
566 566
 
567
-        return 'cid:' . $entity->getId();
567
+        return 'cid:'.$entity->getId();
568 568
     }
569 569
 
570 570
     /**
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.
lib/classes/Swift/ByteStream/FileByteStream.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.