Файл: monst/Xsolla/Guzzle/Http/Message/Header/HeaderFactory.php
Строк: 19
<?php
namespace GuzzleHttpMessageHeader;
use GuzzleHttpMessageHeader;
/**
* Default header factory implementation
*/
class HeaderFactory implements HeaderFactoryInterface
{
/** @var array */
protected $mapping = array(
'cache-control' => 'GuzzleHttpMessageHeaderCacheControl',
'link' => 'GuzzleHttpMessageHeaderLink',
);
public function createHeader($header, $value = null)
{
$lowercase = strtolower($header);
return isset($this->mapping[$lowercase])
? new $this->mapping[$lowercase]($header, $value)
: new Header($header, $value);
}
}