diff --git a/system/Commands/Utilities/Routes/FilterCollector.php b/system/Commands/Utilities/Routes/FilterCollector.php index ec1219debe1a..98963bba7d74 100644 --- a/system/Commands/Utilities/Routes/FilterCollector.php +++ b/system/Commands/Utilities/Routes/FilterCollector.php @@ -37,7 +37,8 @@ public function __construct( } /** - * Returns filters for the URI + * Returns filters for the URI based on the HTTP method. + * The HTTP method is compared case-sensitively. * * @param string $method HTTP verb like `GET`,`POST` or `CLI`. * @param string $uri URI path to find filters for @@ -46,25 +47,8 @@ public function __construct( */ public function get(string $method, string $uri): array { - if ($method === strtolower($method)) { - @trigger_error( - 'Passing lowercase HTTP method "' . $method . '" is deprecated.' - . ' Use uppercase HTTP method like "' . strtoupper($method) . '".', - E_USER_DEPRECATED, - ); - } - - /** - * @deprecated 4.5.0 - * @TODO Remove this in the future. - */ - $method = strtoupper($method); - if ($method === 'CLI') { - return [ - 'before' => [], - 'after' => [], - ]; + return ['before' => [], 'after' => []]; } $request = service('incomingrequest', null, false); @@ -79,7 +63,8 @@ public function get(string $method, string $uri): array } /** - * Returns filter classes for the URI + * Returns filter classes for the URI based on the HTTP method. + * The HTTP method is compared case-sensitively. * * @param string $method HTTP verb like `GET`,`POST` or `CLI`. * @param string $uri URI path to find filters for @@ -88,25 +73,8 @@ public function get(string $method, string $uri): array */ public function getClasses(string $method, string $uri): array { - if ($method === strtolower($method)) { - @trigger_error( - 'Passing lowercase HTTP method "' . $method . '" is deprecated.' - . ' Use uppercase HTTP method like "' . strtoupper($method) . '".', - E_USER_DEPRECATED, - ); - } - - /** - * @deprecated 4.5.0 - * @TODO Remove this in the future. - */ - $method = strtoupper($method); - if ($method === 'CLI') { - return [ - 'before' => [], - 'after' => [], - ]; + return ['before' => [], 'after' => []]; } $request = service('incomingrequest', null, false); diff --git a/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php b/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php index fb6c0e5e8ebd..c6789c6e43f4 100644 --- a/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php +++ b/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php @@ -34,12 +34,6 @@ public function testGet(): void $filters = $collector->get(Method::GET, '/'); - $expected = [ - 'before' => [ - ], - 'after' => [ - ], - ]; - $this->assertSame($expected, $filters); + $this->assertSame(['before' => [], 'after' => []], $filters); } } diff --git a/user_guide_src/source/changelogs/v4.8.0.rst b/user_guide_src/source/changelogs/v4.8.0.rst index 135f620e31fd..277c755b5e6e 100644 --- a/user_guide_src/source/changelogs/v4.8.0.rst +++ b/user_guide_src/source/changelogs/v4.8.0.rst @@ -23,6 +23,8 @@ BREAKING Behavior Changes ================ +- **Commands:** The ``filter:check`` command now requires the HTTP method argument to be uppercase (e.g., ``spark filter:check GET /`` instead of ``spark filter:check get /``). + Interface Changes =================