Skip to content

Commit

Permalink
Add support of HTTP/3.0 (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
devanych authored May 27, 2024
1 parent 98ab6af commit 43847e0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/MessageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ trait MessageTrait
*
* @var string[]
*/
private static array $supportedProtocolVersions = ['1.0', '1.1', '2.0', '2'];
private static array $supportedProtocolVersions = ['1.0', '1.1', '2.0', '2', '3.0', '3'];

/**
* Map of all registered original headers, as `original header name` => `array of values`.
Expand Down
5 changes: 3 additions & 2 deletions src/RequestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function getMethod(): string
* @param string $method Case-sensitive method.
* @return static
* @throws InvalidArgumentException for invalid HTTP methods.
* @psalm-suppress DocblockTypeContradiction
* @psalm-suppress DocblockTypeContradiction, TypeDoesNotContainType, NoValue, RedundantCondition
*/
public function withMethod($method): RequestInterface
{
Expand Down Expand Up @@ -241,7 +241,7 @@ private function init(
/**
* @param UriInterface|string $uri
* @throws InvalidArgumentException for invalid URI.
* @psalm-suppress RedundantConditionGivenDocblockType
* @psalm-suppress TypeDoesNotContainType, NoValue, RedundantCondition
*/
private function setUri($uri): void
{
Expand All @@ -265,6 +265,7 @@ private function setUri($uri): void
* Updates `Host` header from the current URI and sets the `Host` first in the list of headers.
*
* @see https://tools.ietf.org/html/rfc7230#section-5.4
* @psalm-suppress RiskyTruthyFalsyComparison
*/
private function updateHostHeaderFromUri(): void
{
Expand Down
1 change: 1 addition & 0 deletions src/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public function getStatusCode(): int
* @psalm-suppress DocblockTypeContradiction
* @psalm-suppress TypeDoesNotContainType
* @psalm-suppress RedundantCondition
* @psalm-suppress InvalidCast
* @psalm-suppress NoValue
*/
public function withStatus($code, $reasonPhrase = ''): ResponseInterface
Expand Down
2 changes: 2 additions & 0 deletions src/StreamTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public function eof(): bool
* Returns whether or not the stream is seekable.
*
* @return bool
* @psalm-suppress RiskyTruthyFalsyComparison
*/
public function isSeekable(): bool
{
Expand Down Expand Up @@ -363,6 +364,7 @@ public function getContents(): string
* @return array|mixed|null Returns an associative array if no key is
* provided. Returns a specific key value if a key is provided and the
* value is found, or null if the key is not found.
* @psalm-suppress RiskyTruthyFalsyComparison
*/
public function getMetadata($key = null)
{
Expand Down
1 change: 1 addition & 0 deletions src/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ public function withFragment($fragment): UriInterface
* @param string $scheme
* @return string
* @throws InvalidArgumentException for invalid or unsupported schemes.
* @psalm-suppress RiskyTruthyFalsyComparison
*/
private function normalizeScheme(string $scheme): string
{
Expand Down

0 comments on commit 43847e0

Please sign in to comment.