Added back some toArray() implementations.

This commit is contained in:
Qiang Xue
2014-03-07 22:05:45 -05:00
parent b3b515b9d1
commit ad19e332f4
3 changed files with 23 additions and 0 deletions

View File

@ -159,6 +159,16 @@ class HeaderCollection extends Object implements \IteratorAggregate, \ArrayAcces
$this->_headers = [];
}
/**
* Returns the collection as a PHP array.
* @return array the array representation of the collection.
* The array keys are header names, and the array values are the corresponding header values.
*/
public function toArray()
{
return $this->_headers;
}
/**
* Returns whether there is a header with the specified name.
* This method is required by the SPL interface `ArrayAccess`.