From 7e0aa38cf269ef199fc13952234bc0fd94150b1f Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 9 Aug 2026 16:00:58 +0200 Subject: [PATCH] add Method::query --- CHANGELOG.md | 4 ++++ src/Method.php | 5 +++++ tests/MethodTest.php | 1 + 3 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb733f8..42a6267 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Added + +- `Innmind\Http\Method::query` + ### Changed - Requires PHP `8.5` diff --git a/src/Method.php b/src/Method.php index 9746585..03d506d 100644 --- a/src/Method.php +++ b/src/Method.php @@ -11,6 +11,7 @@ enum Method { case get; + case query; case post; case put; case patch; @@ -31,6 +32,7 @@ public static function of(string $method): self { return match ($method) { 'GET' => self::get, + 'QUERY' => self::query, 'POST' => self::post, 'PUT' => self::put, 'PATCH' => self::patch, @@ -65,6 +67,7 @@ public function safe(): bool { return match ($this) { self::get => true, + self::query => true, self::post => false, self::put => false, self::patch => false, @@ -83,6 +86,7 @@ public function idempotent(): bool { return match ($this) { self::get => true, + self::query => true, self::post => false, self::put => true, self::patch => false, @@ -101,6 +105,7 @@ public function toString(): string { return match ($this) { self::get => 'GET', + self::query => 'QUERY', self::post => 'POST', self::put => 'PUT', self::patch => 'PATCH', diff --git a/tests/MethodTest.php b/tests/MethodTest.php index 03f5ce4..c7a2d18 100644 --- a/tests/MethodTest.php +++ b/tests/MethodTest.php @@ -37,6 +37,7 @@ public function methods(): Set { return Set\Elements::of( 'GET', + 'QUERY', 'POST', 'PUT', 'PATCH',