| @@ -107,7 +107,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 |      { | 
| @@ -560,7 +560,7 @@ | ||
| 560 | 560 |      { | 
| 561 | 561 | $this->attach($entity); | 
| 562 | 562 | |
| 563 | - return 'cid:' . $entity->getId(); | |
| 563 | + return 'cid:'.$entity->getId(); | |
| 564 | 564 | } | 
| 565 | 565 | |
| 566 | 566 | /** | 
| @@ -435,6 +435,9 @@ | ||
| 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) { | 
| @@ -145,7 +145,7 @@ discard block | ||
| 145 | 145 |      { | 
| 146 | 146 | $this->_privateKey = $privateKey; | 
| 147 | 147 | $this->_domainName = $domainName; | 
| 148 | - $this->_signerIdentity = '@' . $domainName; | |
| 148 | + $this->_signerIdentity = '@'.$domainName; | |
| 149 | 149 | $this->_selector = $selector; | 
| 150 | 150 | } | 
| 151 | 151 | |
| @@ -425,7 +425,7 @@ discard block | ||
| 425 | 425 |          $params = array('a' => $this->_hashAlgorithm, 'b' => chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '), 'c' => $this->_canon, 'd' => $this->_domainName, 'h' => implode(': ', $this->_signedHeaders), 'q' => 'dns', 's' => $this->_selector); | 
| 426 | 426 | $string = ''; | 
| 427 | 427 |          foreach ($params as $k => $v) { | 
| 428 | - $string .= $k . '=' . $v . '; '; | |
| 428 | + $string .= $k.'='.$v.'; '; | |
| 429 | 429 | } | 
| 430 | 430 | $string = trim($string); | 
| 431 | 431 |          $headers->addTextHeader('DomainKey-Signature', $string); | 
| @@ -444,7 +444,7 @@ discard block | ||
| 444 | 444 | $name = Swift::strtolowerWithStaticCache(trim($exploded[0])); | 
| 445 | 445 |                  $value = str_replace("\r\n", '', $exploded[1]); | 
| 446 | 446 |                  $value = preg_replace("/[ \t][ \t]+/", ' ', $value); | 
| 447 | - $header = $name . ':' . trim($value) . "\r\n"; | |
| 447 | + $header = $name.':'.trim($value)."\r\n"; | |
| 448 | 448 | case 'simple': | 
| 449 | 449 | // Nothing to do | 
| 450 | 450 | } | 
| @@ -544,11 +544,11 @@ discard block | ||
| 544 | 544 | $signature = ''; | 
| 545 | 545 | $pkeyId = openssl_get_privatekey($this->_privateKey); | 
| 546 | 546 |          if (!$pkeyId) { | 
| 547 | -            throw new Swift_SwiftException('Unable to load DomainKey Private Key [' . openssl_error_string() . ']'); | |
| 547 | +            throw new Swift_SwiftException('Unable to load DomainKey Private Key ['.openssl_error_string().']'); | |
| 548 | 548 | } | 
| 549 | 549 |          if (openssl_sign($this->_canonData, $signature, $pkeyId, OPENSSL_ALGO_SHA1)) { | 
| 550 | 550 | return $signature; | 
| 551 | 551 | } | 
| 552 | -        throw new Swift_SwiftException('Unable to sign DomainKey Hash  [' . openssl_error_string() . ']'); | |
| 552 | +        throw new Swift_SwiftException('Unable to sign DomainKey Hash  ['.openssl_error_string().']'); | |
| 553 | 553 | } | 
| 554 | 554 | } | 
| @@ -30,6 +30,6 @@ | ||
| 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 | } | 
| @@ -435,6 +435,9 @@ | ||
| 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) { | 
| @@ -201,7 +201,7 @@ discard block | ||
| 201 | 201 |      { | 
| 202 | 202 | $this->_privateKey = $privateKey; | 
| 203 | 203 | $this->_domainName = $domainName; | 
| 204 | - $this->_signerIdentity = '@' . $domainName; | |
| 204 | + $this->_signerIdentity = '@'.$domainName; | |
| 205 | 205 | $this->_selector = $selector; | 
| 206 | 206 | } | 
| 207 | 207 | |
| @@ -549,7 +549,7 @@ discard block | ||
| 549 | 549 | // Prepare the DKIM-Signature | 
| 550 | 550 |          $params = array('v' => '1', 'a' => $this->_hashAlgorithm, 'bh' => base64_encode($this->_bodyHash), 'd' => $this->_domainName, 'h' => implode(': ', $this->_signedHeaders), 'i' => $this->_signerIdentity, 's' => $this->_selector); | 
| 551 | 551 |          if ($this->_bodyCanon != 'simple') { | 
| 552 | - $params['c'] = $this->_headerCanon . '/' . $this->_bodyCanon; | |
| 552 | + $params['c'] = $this->_headerCanon.'/'.$this->_bodyCanon; | |
| 553 | 553 |          } elseif ($this->_headerCanon != 'simple') { | 
| 554 | 554 | $params['c'] = $this->_headerCanon; | 
| 555 | 555 | } | 
| @@ -574,19 +574,19 @@ discard block | ||
| 574 | 574 | } | 
| 575 | 575 | $string = ''; | 
| 576 | 576 |          foreach ($params as $k => $v) { | 
| 577 | - $string .= $k . '=' . $v . '; '; | |
| 577 | + $string .= $k.'='.$v.'; '; | |
| 578 | 578 | } | 
| 579 | 579 | $string = trim($string); | 
| 580 | 580 |          $headers->addTextHeader('DKIM-Signature', $string); | 
| 581 | 581 | // Add the last DKIM-Signature | 
| 582 | 582 |          $tmp = $headers->getAll('DKIM-Signature'); | 
| 583 | 583 | $this->_dkimHeader = end($tmp); | 
| 584 | - $this->_addHeader(trim($this->_dkimHeader->toString()) . "\r\n b=", true); | |
| 584 | + $this->_addHeader(trim($this->_dkimHeader->toString())."\r\n b=", true); | |
| 585 | 585 | $this->_endOfHeaders(); | 
| 586 | 586 |          if ($this->_debugHeaders) { | 
| 587 | 587 |              $headers->addTextHeader('X-DebugHash', base64_encode($this->_headerHash)); | 
| 588 | 588 | } | 
| 589 | - $this->_dkimHeader->setValue($string . ' b=' . trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '))); | |
| 589 | + $this->_dkimHeader->setValue($string.' b='.trim(chunk_split(base64_encode($this->_getEncryptedHash()), 73, ' '))); | |
| 590 | 590 | |
| 591 | 591 | return $this; | 
| 592 | 592 | } | 
| @@ -602,7 +602,7 @@ discard block | ||
| 602 | 602 | $name = Swift::strtolowerWithStaticCache(trim($exploded[0])); | 
| 603 | 603 |                  $value = str_replace("\r\n", '', $exploded[1]); | 
| 604 | 604 |                  $value = preg_replace("/[ \t][ \t]+/", ' ', $value); | 
| 605 | - $header = $name . ':' . trim($value) . ($is_sig ? '' : "\r\n"); | |
| 605 | + $header = $name.':'.trim($value).($is_sig ? '' : "\r\n"); | |
| 606 | 606 | case 'simple': | 
| 607 | 607 | // Nothing to do | 
| 608 | 608 | } | 
| @@ -723,11 +723,11 @@ discard block | ||
| 723 | 723 | } | 
| 724 | 724 | $pkeyId = openssl_get_privatekey($this->_privateKey); | 
| 725 | 725 |          if (!$pkeyId) { | 
| 726 | -            throw new Swift_SwiftException('Unable to load DKIM Private Key [' . openssl_error_string() . ']'); | |
| 726 | +            throw new Swift_SwiftException('Unable to load DKIM Private Key ['.openssl_error_string().']'); | |
| 727 | 727 | } | 
| 728 | 728 |          if (openssl_sign($this->_headerCanonData, $signature, $pkeyId, $algorithm)) { | 
| 729 | 729 | return $signature; | 
| 730 | 730 | } | 
| 731 | -        throw new Swift_SwiftException('Unable to sign DKIM Hash [' . openssl_error_string() . ']'); | |
| 731 | +        throw new Swift_SwiftException('Unable to sign DKIM Hash ['.openssl_error_string().']'); | |
| 732 | 732 | } | 
| 733 | 733 | } | 
| @@ -810,6 +810,9 @@ | ||
| 810 | 810 | } | 
| 811 | 811 | } | 
| 812 | 812 | |
| 813 | + /** | |
| 814 | + * @param integer $level | |
| 815 | + */ | |
| 813 | 816 | private function _setNestingLevel($level) | 
| 814 | 817 |      { | 
| 815 | 818 | $this->_nestingLevel = $level; | 
| @@ -468,7 +468,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | |
| @@ -77,9 +77,9 @@ | ||
| 77 | 77 | } | 
| 78 | 78 | |
| 79 | 79 | $count = ( | 
| 80 | - count((array)$message->getTo()) | |
| 81 | - + count((array)$message->getCc()) | |
| 82 | - + count((array)$message->getBcc()) | |
| 80 | + count((array) $message->getTo()) | |
| 81 | + + count((array) $message->getCc()) | |
| 82 | + + count((array) $message->getBcc()) | |
| 83 | 83 | ); | 
| 84 | 84 | |
| 85 | 85 | return $count; | 
| @@ -111,7 +111,7 @@ | ||
| 111 | 111 |          if ($i !== null) { | 
| 112 | 112 | $tree[-1] = min(count($replace) - 1, $i); | 
| 113 | 113 | $tree[-2] = $last_size; | 
| 114 | - $this->_treeMaxLen = (int)$size; | |
| 114 | + $this->_treeMaxLen = (int) $size; | |
| 115 | 115 | } | 
| 116 | 116 |          foreach ($replace as $rep) { | 
| 117 | 117 |              if (!is_array($rep)) { | 
| @@ -8,17 +8,17 @@ | ||
| 8 | 8 | * file that was distributed with this source code. | 
| 9 | 9 | */ | 
| 10 | 10 | |
| 11 | -require __DIR__ . '/classes/Swift.php'; | |
| 11 | +require __DIR__.'/classes/Swift.php'; | |
| 12 | 12 | |
| 13 | 13 | Swift::registerAutoload( | 
| 14 | -    function () { | |
| 14 | +    function() { | |
| 15 | 15 | // Load in dependency maps | 
| 16 | - require __DIR__ . '/dependency_maps/cache_deps.php'; | |
| 17 | - require __DIR__ . '/dependency_maps/mime_deps.php'; | |
| 18 | - require __DIR__ . '/dependency_maps/message_deps.php'; | |
| 19 | - require __DIR__ . '/dependency_maps/transport_deps.php'; | |
| 16 | + require __DIR__.'/dependency_maps/cache_deps.php'; | |
| 17 | + require __DIR__.'/dependency_maps/mime_deps.php'; | |
| 18 | + require __DIR__.'/dependency_maps/message_deps.php'; | |
| 19 | + require __DIR__.'/dependency_maps/transport_deps.php'; | |
| 20 | 20 | |
| 21 | 21 | // Load in global library preferences | 
| 22 | - require __DIR__ . '/preferences.php'; | |
| 22 | + require __DIR__.'/preferences.php'; | |
| 23 | 23 | } | 
| 24 | 24 | ); | 
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | -require __DIR__ . '/../mime_types.php'; | |
| 3 | +require __DIR__.'/../mime_types.php'; | |
| 4 | 4 | |
| 5 | 5 | Swift_DependencyContainer::getInstance() | 
| 6 | 6 |      ->register('properties.charset') |