mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-23 21:16:02 +03:00
27 lines
646 B
PHP
27 lines
646 B
PHP
|
<?php
|
||
|
|
||
|
namespace Guzzle\Http\Message\Header;
|
||
|
|
||
|
use Guzzle\Http\Message\Header;
|
||
|
|
||
|
/**
|
||
|
* Default header factory implementation
|
||
|
*/
|
||
|
class HeaderFactory implements HeaderFactoryInterface
|
||
|
{
|
||
|
/** @var array */
|
||
|
protected $mapping = array(
|
||
|
'cache-control' => 'Guzzle\Http\Message\Header\CacheControl',
|
||
|
'link' => 'Guzzle\Http\Message\Header\Link',
|
||
|
);
|
||
|
|
||
|
public function createHeader($header, $value = null)
|
||
|
{
|
||
|
$lowercase = strtolower($header);
|
||
|
|
||
|
return isset($this->mapping[$lowercase])
|
||
|
? new $this->mapping[$lowercase]($header, $value)
|
||
|
: new Header($header, $value);
|
||
|
}
|
||
|
}
|