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

Commit

Permalink
Merge branch 'cache_internals' of https://github.com/marc-mabe/zf2 in…
Browse files Browse the repository at this point in the history
…to hotfix/cache-internals
  • Loading branch information
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 46 deletions.
30 changes: 15 additions & 15 deletions src/Header/AbstractAddressList.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ abstract class AbstractAddressList implements Header

/**
* Header encoding
*
*
* @var string
*/
protected $encoding = 'ASCII';
Expand All @@ -59,8 +59,8 @@ abstract class AbstractAddressList implements Header

/**
* Parse string to create header object
*
* @param string $headerLine
*
* @param string $headerLine
* @return AbstractAddressList
*/
public static function fromString($headerLine)
Expand All @@ -86,7 +86,7 @@ public static function fromString($headerLine)
$addressList = $header->getAddressList();
foreach ($values as $address) {
// split values into name/email
if (!preg_match('/^((?<name>.*?)<(?<namedEmail>[^>]+)>|(?<email>.+))$/', $address, $matches)) {
if (!preg_match('/^((?P<name>.*?)<(?P<namedEmail>[^>]+)>|(?P<email>.+))$/', $address, $matches)) {
// Should we raise an exception here?
continue;
}
Expand Down Expand Up @@ -117,7 +117,7 @@ public static function fromString($headerLine)

/**
* Get field name of this header
*
*
* @return string
*/
public function getFieldName()
Expand All @@ -127,7 +127,7 @@ public function getFieldName()

/**
* Get field value of this header
*
*
* @return string
*/
public function getFieldValue()
Expand Down Expand Up @@ -156,19 +156,19 @@ public function getFieldValue()

/**
* Set header encoding
*
* @param string $encoding
*
* @param string $encoding
* @return AbstractAddressList
*/
public function setEncoding($encoding)
public function setEncoding($encoding)
{
$this->encoding = $encoding;
return $this;
}

/**
* Get header encoding
*
*
* @return string
*/
public function getEncoding()
Expand All @@ -178,8 +178,8 @@ public function getEncoding()

/**
* Set address list for this header
*
* @param AddressList $addressList
*
* @param AddressList $addressList
* @return void
*/
public function setAddressList(AddressList $addressList)
Expand All @@ -189,7 +189,7 @@ public function setAddressList(AddressList $addressList)

/**
* Get address list managed by this header
*
*
* @return AddressList
*/
public function getAddressList()
Expand All @@ -202,7 +202,7 @@ public function getAddressList()

/**
* Serialize to string
*
*
* @return string
*/
public function toString()
Expand All @@ -211,4 +211,4 @@ public function toString()
$value = $this->getFieldValue();
return sprintf("%s: %s\r\n", $name, $value);
}
}
}
26 changes: 13 additions & 13 deletions src/Header/MimeVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class MimeVersion implements Header

/**
* Deserialize from string
*
* @param string $headerLine
*
* @param string $headerLine
* @return MimeVersion
*/
public static function fromString($headerLine)
Expand All @@ -54,16 +54,16 @@ public static function fromString($headerLine)

// Check for version, and set if found
$header = new static();
if (preg_match('/^(?<version>\d+\.\d+)$/', $value, $matches)) {
if (preg_match('/^(?P<version>\d+\.\d+)$/', $value, $matches)) {
$header->version = $matches['version'];
}

return $header;
}

/**
* Get the field name
*
*
* @return string
*/
public function getFieldName()
Expand All @@ -73,7 +73,7 @@ public function getFieldName()

/**
* Get the field value (version string)
*
*
* @return string
*/
public function getFieldValue()
Expand All @@ -83,8 +83,8 @@ public function getFieldValue()

/**
* Set character encoding
*
* @param string $encoding
*
* @param string $encoding
* @return void
*/
public function setEncoding($encoding)
Expand All @@ -94,7 +94,7 @@ public function setEncoding($encoding)

/**
* Get character encoding
*
*
* @return void
*/
public function getEncoding()
Expand All @@ -104,17 +104,17 @@ public function getEncoding()

/**
* Serialize to string
*
*
* @return string
*/
public function toString()
{
return 'Mime-Version: ' . $this->getFieldValue();
}

/**
* Set the version string used in this header
*
*
* @param string $version
* @return MimeVersion
*/
Expand All @@ -126,7 +126,7 @@ public function setVersion($version)

/**
* Retrieve the version string for this header
*
*
* @return string
*/
public function getVersion()
Expand Down
36 changes: 18 additions & 18 deletions src/Header/Sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ class Sender implements Header

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

/**
* Factory: create Sender header object from string
*
* @param string $headerLine
*
* @param string $headerLine
* @return Sender
* @throws Exception\InvalidArgumentException on invalid header line
*/
Expand All @@ -66,7 +66,7 @@ public static function fromString($headerLine)
$header = new static();

// Check for address, and set if found
if (preg_match('^(?<name>.*?)<(?<email>[^>]+)>$', $value, $matches)) {
if (preg_match('^(?P<name>.*?)<(?P<email>[^>]+)>$', $value, $matches)) {
$name = $matches['name'];
if (empty($name)) {
$name = null;
Expand All @@ -75,13 +75,13 @@ public static function fromString($headerLine)
}
$header->setAddress($matches['email'], $name);
}

return $header;
}

/**
* Get header name
*
*
* @return string
*/
public function getFieldName()
Expand All @@ -91,7 +91,7 @@ public function getFieldName()

/**
* Get header value
*
*
* @return string
*/
public function getFieldValue()
Expand All @@ -114,19 +114,19 @@ public function getFieldValue()

/**
* Set header encoding
*
* @param string $encoding
*
* @param string $encoding
* @return Sender
*/
public function setEncoding($encoding)
public function setEncoding($encoding)
{
$this->encoding = $encoding;
return $this;
}

/**
* Get header encoding
*
*
* @return string
*/
public function getEncoding()
Expand All @@ -136,19 +136,19 @@ public function getEncoding()

/**
* Serialize to string
*
*
* @return string
*/
public function toString()
{
return 'Sender: ' . $this->getFieldValue();
}

/**
* Set the address used in this header
*
* @param string|AddressDescription $emailOrAddress
* @param null|string $name
*
* @param string|AddressDescription $emailOrAddress
* @param null|string $name
* @return Sender
*/
public function setAddress($emailOrAddress, $name = null)
Expand All @@ -159,7 +159,7 @@ public function setAddress($emailOrAddress, $name = null)
if (!$emailOrAddress instanceof AddressDescription) {
throw new Exception\InvalidArgumentException(sprintf(
'%s expects a string or AddressDescription object; received "%s"',
__METHOD__,
__METHOD__,
(is_object($emailOrAddress) ? get_class($emailOrAddress) : gettype($emailOrAddress))
));
}
Expand All @@ -169,7 +169,7 @@ public function setAddress($emailOrAddress, $name = null)

/**
* Retrieve the internal address from this header
*
*
* @return AddressDescription|null
*/
public function getAddress()
Expand Down

0 comments on commit a634561

Please sign in to comment.