Initial commit

This commit is contained in:
2024-02-24 20:44:06 +01:00
commit fb1ce8cbc1
11 changed files with 669 additions and 0 deletions

27
src/Header/HeaderBag.php Normal file
View File

@ -0,0 +1,27 @@
<?php
namespace NoccyLabs\React\Http2\Header;
use NoccyLabs\React\Http2\Huffman\Codec;
use NoccyLabs\React\Http2\Huffman\Dictionary;
/**
* An ordered list of HTTP/2 headers
*
*
*/
class HeaderBag
{
private array $headers = [];
public function __construct(array $headers = [])
{
foreach ($headers as $name=>$value) $this->append($name, $value);
}
public function append(string $name, string $value)
{
$this->headers[] = [ $name, $value ];
}
}