for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @category Brownie/HttpClient
* @author Brownie <[email protected]>
* @license https://opensource.org/licenses/MIT
*/
namespace Brownie\HttpClient\Header;
use Brownie\HttpClient\HeadList;
* HTTP headers collection.
class HeaderList extends HeadList
{
* Returns the HTTP header skip flag.
*
* @param string $headerLine HTTP header line.
* @return bool
protected function isSkipHeaderLine($headerLine)
return ($this->isHeaderHTTP($headerLine) || $this->isHeaderSetCookie($headerLine));
}
* Creates a data model for the collection.
* @return Header
public function createCollectionItem($headerLine)
return new Header($this->getParams($headerLine));
* Returns HTTP header parameters.
* @return array
private function getParams($headerLine)
$pairParam = explode(':', trim($headerLine), 2);
return array(
'name' => trim($pairParam[0]),
'value' => trim($pairParam[1])
);