diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-12-22 09:16:08 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-12-22 09:16:08 +0100 |
commit | 5697f7c92cbc7b2c23d2a8c6ba3d904734dd0739 (patch) | |
tree | d9c7d8cf5b7a42d505ceb06d63a9e00fa212daf8 /vendor/fguillot/picofeed/lib/PicoFeed/Client/HttpHeaders.php | |
parent | d2d16c4c26f8f9a7ee97350e5cba5c3554c51013 (diff) |
udpate picofeed
Diffstat (limited to 'vendor/fguillot/picofeed/lib/PicoFeed/Client/HttpHeaders.php')
-rw-r--r-- | vendor/fguillot/picofeed/lib/PicoFeed/Client/HttpHeaders.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Client/HttpHeaders.php b/vendor/fguillot/picofeed/lib/PicoFeed/Client/HttpHeaders.php new file mode 100644 index 000000000..4453a7871 --- /dev/null +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Client/HttpHeaders.php @@ -0,0 +1,43 @@ +<?php + +namespace PicoFeed\Client; + +use ArrayAccess; + +/** + * Class to handle http headers case insensitivity + * + * @author Bernhard Posselt + * @package Client + */ +class HttpHeaders implements ArrayAccess +{ + private $headers = array(); + + public function __construct(array $headers) + { + foreach ($headers as $key => $value) { + $this->headers[strtolower($key)] = $value; + } + } + + public function offsetGet($offset) + { + return $this->headers[strtolower($offset)]; + } + + public function offsetSet($offset, $value) + { + $this->headers[strtolower($offset)] = $value; + } + + public function offsetExists($offset) + { + return isset($this->headers[strtolower($offset)]); + } + + public function offsetUnset($offset) + { + unset($this->headers[strtolower($offset)]); + } +} |