Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 24 changed files with 225 additions and 224 deletions.
6 changes: 3 additions & 3 deletions src/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct($email, $name = null)

/**
* Retrieve email
*
*
* @return string
*/
public function getEmail()
Expand All @@ -64,7 +64,7 @@ public function getEmail()

/**
* Retrieve name
*
*
* @return string
*/
public function getName()
Expand All @@ -74,7 +74,7 @@ public function getName()

/**
* String representation of address
*
*
* @return string
*/
public function toString()
Expand Down
34 changes: 17 additions & 17 deletions src/AddressList.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AddressList implements Countable, Iterator
{
/**
* List of Address objects we're managing
*
*
* @var array
*/
protected $addresses = array();
Expand Down Expand Up @@ -97,9 +97,9 @@ public function addMany(array $addresses)
}

/**
* Merge another address list into this one
*
* @param AddressList $addressList
* Merge another address list into this one
*
* @param AddressList $addressList
* @return AddressList
*/
public function merge(AddressList $addressList)
Expand All @@ -112,8 +112,8 @@ public function merge(AddressList $addressList)

/**
* Does the email exist in this list?
*
* @param string $email
*
* @param string $email
* @return bool
*/
public function has($email)
Expand All @@ -124,8 +124,8 @@ public function has($email)

/**
* Get an address by email
*
* @param string $email
*
* @param string $email
* @return boolean|Address\AddressInterface
*/
public function get($email)
Expand All @@ -140,7 +140,7 @@ public function get($email)

/**
* Delete an address from the list
*
*
* @param string $email
* @return bool
*/
Expand All @@ -157,7 +157,7 @@ public function delete($email)

/**
* Return count of addresses
*
*
* @return int
*/
public function count()
Expand All @@ -179,7 +179,7 @@ public function rewind()

/**
* Return current item in iteration
*
*
* @return Address
*/
public function current()
Expand All @@ -189,7 +189,7 @@ public function current()

/**
* Return key of current item of iteration
*
*
* @return string
*/
public function key()
Expand All @@ -211,7 +211,7 @@ public function next()

/**
* Is the current item of iteration valid?
*
*
* @return bool
*/
public function valid()
Expand All @@ -221,10 +221,10 @@ public function valid()
}

/**
* Create an address object
*
* @param string $email
* @param string|null $name
* Create an address object
*
* @param string $email
* @param string|null $name
* @return Address
*/
protected function createAddress($email, $name)
Expand Down
4 changes: 2 additions & 2 deletions src/Header/AbstractAddressList.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ abstract class AbstractAddressList implements HeaderInterface
*/
public static function fromString($headerLine)
{
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');

// split into name/value
list($fieldName, $fieldValue) = explode(': ', $headerLine, 2);
Expand Down Expand Up @@ -98,7 +98,7 @@ public static function fromString($headerLine)
if (empty($name)) {
$name = null;
} else {
$name = iconv_mime_decode($name, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
$name = iconv_mime_decode($name, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');
}

if (isset($matches['namedEmail'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/Header/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ContentType implements HeaderInterface
*/
public static function fromString($headerLine)
{
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');
list($name, $value) = explode(': ', $headerLine, 2);

// check to ensure proper header type for this factory
Expand Down
2 changes: 1 addition & 1 deletion src/Header/GenericHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class GenericHeader implements HeaderInterface
*/
public static function fromString($headerLine)
{
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');
$parts = explode(': ', $headerLine, 2);
if (count($parts) != 2) {
throw new Exception\InvalidArgumentException('Header must match with the format "name: value"');
Expand Down
2 changes: 1 addition & 1 deletion src/Header/GenericMultiHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class GenericMultiHeader extends GenericHeader implements MultipleHeadersInterfa
*/
public static function fromString($headerLine)
{
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');
$parts = explode(': ', $headerLine, 2);
if (count($parts) != 2) {
throw new Exception\InvalidArgumentException('Header must match with the format "name: value"');
Expand Down
4 changes: 2 additions & 2 deletions src/Header/Sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Sender implements HeaderInterface
*/
public static function fromString($headerLine)
{
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');
list($name, $value) = explode(': ', $headerLine, 2);

// check to ensure proper header type for this factory
Expand All @@ -69,7 +69,7 @@ public static function fromString($headerLine)
if (empty($name)) {
$name = null;
} else {
$name = iconv_mime_decode($name, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
$name = iconv_mime_decode($name, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');
}
$header->setAddress($matches['email'], $name);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Header/Subject.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Subject implements UnstructuredInterface
*/
public static function fromString($headerLine)
{
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8');
list($name, $value) = explode(': ', $headerLine, 2);

// check to ensure proper header type for this factory
Expand Down
6 changes: 5 additions & 1 deletion src/Headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ public function get($name)
$results = array();

foreach (array_keys($this->headersKeys, $key) as $index) {
$results[] = $this->headers[$index];
if ($this->headers[$index] instanceof Header\GenericHeader) {
$results[] = $this->lazyLoadHeader($index);
} else {
$results[] = $this->headers[$index];
}
}

switch(count($results)) {
Expand Down
Loading

0 comments on commit ab9047d

Please sign in to comment.