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

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 42 deletions.
15 changes: 4 additions & 11 deletions src/Header/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
*/
class ContentType implements HeaderInterface
{
/**
* Header encoding
*
* @var string
*/
protected $encoding = 'ASCII';

/**
* @var string
*/
Expand Down Expand Up @@ -56,7 +49,7 @@ public static function fromString($headerLine)
if (count($values)) {
foreach ($values as $keyValuePair) {
list($key, $value) = explode('=', $keyValuePair);
$value = trim($value, "\"\' \t\n\r\0\x0B");
$value = trim($value, "'\" \t\n\r\0\x0B");
$header->addParameter($key, $value);
}
}
Expand Down Expand Up @@ -86,18 +79,18 @@ public function getFieldValue($format = HeaderInterface::FORMAT_RAW)

public function setEncoding($encoding)
{
$this->encoding = $encoding;
// This header must be always in US-ASCII
return $this;
}

public function getEncoding()
{
return $this->encoding;
return 'ASCII';
}

public function toString()
{
return 'Content-Type: ' . $this->getFieldValue(HeaderInterface::FORMAT_RAW);
return 'Content-Type: ' . $this->getFieldValue();
}

/**
Expand Down
13 changes: 3 additions & 10 deletions src/Header/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ class Date implements HeaderInterface
*/
protected $value;

/**
* Header encoding
*
* @var string
*/
protected $encoding = 'ASCII';

public static function fromString($headerLine)
{
list($name, $value) = explode(': ', $headerLine, 2);
Expand Down Expand Up @@ -57,17 +50,17 @@ public function getFieldValue($format = HeaderInterface::FORMAT_RAW)

public function setEncoding($encoding)
{
$this->encoding = $encoding;
// This header must be always in US-ASCII
return $this;
}

public function getEncoding()
{
return $this->encoding;
return 'ASCII';
}

public function toString()
{
return 'Date: ' . $this->getFieldValue(HeaderInterface::FORMAT_RAW);
return 'Date: ' . $this->getFieldValue();
}
}
7 changes: 4 additions & 3 deletions src/Header/MimeVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,18 @@ public function getFieldValue($format = HeaderInterface::FORMAT_RAW)

public function setEncoding($encoding)
{
// irrelevant to this implementation
// This header must be always in US-ASCII
return $this;
}

public function getEncoding()
{
// irrelevant to this implementation
return 'ASCII';
}

public function toString()
{
return 'MIME-Version: ' . $this->getFieldValue(HeaderInterface::FORMAT_RAW);
return 'MIME-Version: ' . $this->getFieldValue();
}

/**
Expand Down
13 changes: 3 additions & 10 deletions src/Header/Received.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ class Received implements HeaderInterface, MultipleHeadersInterface
*/
protected $value;

/**
* Header encoding
*
* @var string
*/
protected $encoding = 'ASCII';

public static function fromString($headerLine)
{
list($name, $value) = explode(': ', $headerLine, 2);
Expand Down Expand Up @@ -59,18 +52,18 @@ public function getFieldValue($format = HeaderInterface::FORMAT_RAW)

public function setEncoding($encoding)
{
$this->encoding = $encoding;
// This header must be always in US-ASCII
return $this;
}

public function getEncoding()
{
return $this->encoding;
return 'ASCII';
}

public function toString()
{
return 'Received: ' . $this->getFieldValue(HeaderInterface::FORMAT_RAW);
return 'Received: ' . $this->getFieldValue();
}

/**
Expand Down
8 changes: 0 additions & 8 deletions src/Protocol/AbstractProtocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ abstract class AbstractProtocol
protected $_response;


/**
* String template for parsing server responses using sscanf (default: 3 digit code and response string)
* @var resource
* @deprecated Since 1.10.3
*/
protected $_template = '%d%s';


/**
* Log of mail requests and server responses for a session
* @var array
Expand Down

0 comments on commit 09daef8

Please sign in to comment.