Completed
Pull Request — 5.x (#20)
by Lars
18:15
created
lib/classes/Swift/Mime/SimpleMessage.php 1 patch
Doc Comments   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     /**
108 108
      * Get the date at which this message was created.
109 109
      *
110
-     * @return int
110
+     * @return string
111 111
      */
112 112
     public function getDate()
113 113
     {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      * If $name is passed and the first parameter is a string, this name will be
200 200
      * associated with the address.
201 201
      *
202
-     * @param string|array $addresses
202
+     * @param string $addresses
203 203
      * @param string       $name      optional
204 204
      *
205 205
      * @return Swift_Mime_SimpleMessage
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     /**
221 221
      * Get the from address of this message.
222 222
      *
223
-     * @return mixed
223
+     * @return string
224 224
      */
225 225
     public function getFrom()
226 226
     {
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      * If $name is passed and the first parameter is a string, this name will be
254 254
      * associated with the address.
255 255
      *
256
-     * @param mixed  $addresses
256
+     * @param string  $addresses
257 257
      * @param string $name      optional
258 258
      *
259 259
      * @return Swift_Mime_SimpleMessage
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
      * If $name is passed and the first parameter is a string, this name will be
309 309
      * associated with the address.
310 310
      *
311
-     * @param mixed  $addresses
311
+     * @param string  $addresses
312 312
      * @param string $name      optional
313 313
      *
314 314
      * @return Swift_Mime_SimpleMessage
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
     /**
330 330
      * Get the To addresses of this message.
331 331
      *
332
-     * @return array
332
+     * @return string
333 333
      */
334 334
     public function getTo()
335 335
     {
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
      * If $name is passed and the first parameter is a string, this name will be
361 361
      * associated with the address.
362 362
      *
363
-     * @param mixed  $addresses
363
+     * @param string  $addresses
364 364
      * @param string $name      optional
365 365
      *
366 366
      * @return Swift_Mime_SimpleMessage
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
     /**
382 382
      * Get the Cc address of this message.
383 383
      *
384
-     * @return array
384
+     * @return string
385 385
      */
386 386
     public function getCc()
387 387
     {
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
      * If $name is passed and the first parameter is a string, this name will be
413 413
      * associated with the address.
414 414
      *
415
-     * @param mixed  $addresses
415
+     * @param string  $addresses
416 416
      * @param string $name      optional
417 417
      *
418 418
      * @return Swift_Mime_SimpleMessage
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
     /**
434 434
      * Get the Bcc addresses of this message.
435 435
      *
436
-     * @return array
436
+     * @return string
437 437
      */
438 438
     public function getBcc()
439 439
     {
Please login to merge, or discard this patch.
lib/classes/Swift/Signers/DomainKeySigner.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -435,6 +435,9 @@
 block discarded – undo
435 435
 
436 436
     /* Private helpers */
437 437
 
438
+    /**
439
+     * @param string $header
440
+     */
438 441
     protected function _addHeader($header)
439 442
     {
440 443
         switch ($this->_canon) {
Please login to merge, or discard this patch.
lib/classes/Swift/EmailValidatorBridge.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,6 +30,6 @@
 block discarded – undo
30 30
      */
31 31
     public function isValidSimpleWrapper($email)
32 32
     {
33
-        return (boolean)preg_match('/^(.*<?)(.*)@(.*)(>?)$/', $email);
33
+        return (boolean) preg_match('/^(.*<?)(.*)@(.*)(>?)$/', $email);
34 34
     }
35 35
 }
Please login to merge, or discard this patch.
lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -199,7 +199,7 @@
 block discarded – undo
199 199
     {
200 200
         list($domain, $username) = $this->getDomainAndUsername($username);
201 201
         //$challenge, $context, $targetInfoH, $targetName, $domainName, $workstation, $DNSDomainName, $DNSServerName, $blob, $ter
202
-        list($challenge, , , , , $workstation, , , $blob) = $this->parseMessage2($response);
202
+        list($challenge,,,,, $workstation,,, $blob) = $this->parseMessage2($response);
203 203
 
204 204
         if (!$v2) {
205 205
             // LMv1
Please login to merge, or discard this patch.
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
     protected function createMessage1()
227 227
     {
228 228
         return self::NTLMSIG
229
-               . $this->createByte('01') // Message 1
230
-               . $this->createByte('0702'); // Flags
229
+                . $this->createByte('01') // Message 1
230
+                . $this->createByte('0702'); // Flags
231 231
     }
232 232
 
233 233
     /**
@@ -255,19 +255,19 @@  discard block
 block discarded – undo
255 255
         $ntlmSec = $this->createSecurityBuffer($ntlmResponse, ($lmInfo[0] + $lmInfo[1]) / 2, true);
256 256
 
257 257
         return self::NTLMSIG
258
-               . $this->createByte('03') // TYPE 3 message
259
-               . $lmSec // LM response header
260
-               . $ntlmSec // NTLM response header
261
-               . $domainSec // Domain header
262
-               . $userSec // User header
263
-               . $workSec // Workstation header
264
-               . $this->createByte('000000009a', 8) // session key header (empty)
265
-               . $this->createByte('01020000') // FLAGS
266
-               . $this->convertTo16bit($domain) // domain name
267
-               . $this->convertTo16bit($username) // username
268
-               . $this->convertTo16bit($workstation) // workstation
269
-               . $lmResponse
270
-               . $ntlmResponse;
258
+                . $this->createByte('03') // TYPE 3 message
259
+                . $lmSec // LM response header
260
+                . $ntlmSec // NTLM response header
261
+                . $domainSec // Domain header
262
+                . $userSec // User header
263
+                . $workSec // Workstation header
264
+                . $this->createByte('000000009a', 8) // session key header (empty)
265
+                . $this->createByte('01020000') // FLAGS
266
+                . $this->convertTo16bit($domain) // domain name
267
+                . $this->convertTo16bit($username) // username
268
+                . $this->convertTo16bit($workstation) // workstation
269
+                . $lmResponse
270
+                . $ntlmResponse;
271 271
     }
272 272
 
273 273
     /**
@@ -280,12 +280,12 @@  discard block
 block discarded – undo
280 280
     protected function createBlob($timestamp, $client, $targetInfo)
281 281
     {
282 282
         return $this->createByte('0101')
283
-               . $this->createByte('00')
284
-               . $timestamp
285
-               . $client
286
-               . $this->createByte('00')
287
-               . $targetInfo
288
-               . $this->createByte('00');
283
+                . $this->createByte('00')
284
+                . $timestamp
285
+                . $client
286
+                . $this->createByte('00')
287
+                . $targetInfo
288
+                . $this->createByte('00');
289 289
     }
290 290
 
291 291
     /**
@@ -451,16 +451,16 @@  discard block
 block discarded – undo
451 451
         foreach ($material as $k => $v) {
452 452
             $b = $this->castToByte(hexdec($v));
453 453
             $needsParity = (
454
-                               (
455
-                                   $this->uRShift($b, 7)
456
-                                   ^ $this->uRShift($b, 6)
457
-                                   ^ $this->uRShift($b, 5)
458
-                                   ^ $this->uRShift($b, 4)
459
-                                   ^ $this->uRShift($b, 3)
460
-                                   ^ $this->uRShift($b, 2)
461
-                                   ^ $this->uRShift($b, 1)
462
-                               ) & 0x01
463
-                           ) == 0;
454
+                                (
455
+                                    $this->uRShift($b, 7)
456
+                                    ^ $this->uRShift($b, 6)
457
+                                    ^ $this->uRShift($b, 5)
458
+                                    ^ $this->uRShift($b, 4)
459
+                                    ^ $this->uRShift($b, 3)
460
+                                    ^ $this->uRShift($b, 2)
461
+                                    ^ $this->uRShift($b, 1)
462
+                                ) & 0x01
463
+                            ) == 0;
464 464
 
465 465
             list($high, $low) = str_split($v);
466 466
 
Please login to merge, or discard this patch.
lib/classes/Swift/Transport/SendmailTransport.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function send(Swift_Mime_Message $message, &$failedRecipients = null)
101 101
     {
102
-        $failedRecipients = (array)$failedRecipients;
102
+        $failedRecipients = (array) $failedRecipients;
103 103
         $command = $this->getCommand();
104 104
         $buffer = $this->getBuffer();
105 105
         $count = 0;
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
                 $buffer->setWriteTranslations(array("\r\n" => "\n"));
128 128
             }
129 129
 
130
-            $count = count((array)$message->getTo())
131
-                     + count((array)$message->getCc())
132
-                     + count((array)$message->getBcc());
130
+            $count = count((array) $message->getTo())
131
+                     + count((array) $message->getCc())
132
+                     + count((array) $message->getBcc());
133 133
 
134 134
             $message->toByteStream($buffer);
135 135
             $buffer->flushBuffers();
Please login to merge, or discard this patch.
lib/swift_required.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 require __DIR__ . '/classes/Swift.php';
12 12
 
13 13
 Swift::registerAutoload(
14
-    function () {
14
+    function() {
15 15
         // Load in dependency maps
16 16
         require __DIR__ . '/dependency_maps/cache_deps.php';
17 17
         require __DIR__ . '/dependency_maps/mime_deps.php';
Please login to merge, or discard this patch.
lib/classes/Swift/Signers/DKIMSigner.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -435,6 +435,9 @@
 block discarded – undo
435 435
 
436 436
     /* Private helpers */
437 437
 
438
+    /**
439
+     * @param string $header
440
+     */
438 441
     protected function _addHeader($header)
439 442
     {
440 443
         switch ($this->_canon) {
Please login to merge, or discard this patch.
lib/classes/Swift/Transport/EsmtpTransport.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function setPort($port)
93 93
     {
94
-        $this->_params['port'] = (int)$port;
94
+        $this->_params['port'] = (int) $port;
95 95
 
96 96
         return $this;
97 97
     }
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
      */
116 116
     public function setTimeout($timeout)
117 117
     {
118
-        $this->_params['timeout'] = (int)$timeout;
119
-        $this->_buffer->setParam('timeout', (int)$timeout);
118
+        $this->_params['timeout'] = (int) $timeout;
119
+        $this->_buffer->setParam('timeout', (int) $timeout);
120 120
 
121 121
         return $this;
122 122
     }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      */
255 255
     public function executeCommand($command, $codes = array(), &$failures = null)
256 256
     {
257
-        $failures = (array)$failures;
257
+        $failures = (array) $failures;
258 258
         $stopSignal = false;
259 259
         $response = null;
260 260
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
             if (
288 288
             in_array(
289 289
                 strtolower($method),
290
-                array_map('strtolower', (array)$handler->exposeMixinMethods()),
290
+                array_map('strtolower', (array) $handler->exposeMixinMethods()),
291 291
                 true
292 292
             )
293 293
             ) {
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
         $params = array();
373 373
         foreach ($handlers as $handler) {
374
-            $params = array_merge($params, (array)$handler->getMailParams());
374
+            $params = array_merge($params, (array) $handler->getMailParams());
375 375
         }
376 376
 
377 377
         $paramStr = !empty($params) ? ' ' . implode(' ', $params) : '';
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 
392 392
         $params = array();
393 393
         foreach ($handlers as $handler) {
394
-            $params = array_merge($params, (array)$handler->getRcptParams());
394
+            $params = array_merge($params, (array) $handler->getRcptParams());
395 395
         }
396 396
 
397 397
         $paramStr = !empty($params) ? ' ' . implode(' ', $params) : '';
Please login to merge, or discard this patch.
lib/classes/Swift/Transport/AbstractSmtpTransport.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     public function send(Swift_Mime_Message $message, /** @noinspection ParameterByRefWithDefaultInspection */ &$failedRecipients = null)
178 178
     {
179 179
         $sent = 0;
180
-        $failedRecipients = (array)$failedRecipients;
180
+        $failedRecipients = (array) $failedRecipients;
181 181
 
182 182
         $evt = $this->_eventDispatcher->createSendEvent($this, $message);
183 183
         if ($evt) {
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
             );
197 197
         }
198 198
 
199
-        $to = (array)$message->getTo();
200
-        $cc = (array)$message->getCc();
199
+        $to = (array) $message->getTo();
200
+        $cc = (array) $message->getCc();
201 201
         $tos = array_merge($to, $cc);
202
-        $bcc = (array)$message->getBcc();
202
+        $bcc = (array) $message->getBcc();
203 203
 
204 204
         $message->setBcc(array());
205 205
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
      */
309 309
     public function executeCommand($command, $codes = array(), &$failures)
310 310
     {
311
-        $failures = (array)$failures;
311
+        $failures = (array) $failures;
312 312
         $seq = $this->_buffer->write($command);
313 313
         $response = $this->_getFullResponse($seq);
314 314
 
Please login to merge, or discard this patch.