From aa0b779259739555aa06ab15baaa2c14dc113b4d Mon Sep 17 00:00:00 2001 From: Rustam Date: Wed, 8 Apr 2026 16:23:03 +0500 Subject: [PATCH] Mark `Group::create`, `RouteCollectorInterface`, `RouteCollector`, and `Route` HTTP methods as deprecated --- src/Group.php | 2 ++ src/Route.php | 16 ++++++++++++++++ src/RouteCollector.php | 2 ++ src/RouteCollectorInterface.php | 2 ++ 4 files changed, 22 insertions(+) diff --git a/src/Group.php b/src/Group.php index 6d4ea8f..7a3df20 100644 --- a/src/Group.php +++ b/src/Group.php @@ -74,6 +74,8 @@ public function __construct( * Create a new group instance. * * @param string|null $prefix URL prefix to prepend to all routes of the group. + * + * @deprecated Use `new Group()` instead. */ public static function create(?string $prefix = null): self { diff --git a/src/Route.php b/src/Route.php index 6f82f26..c3aef82 100644 --- a/src/Route.php +++ b/src/Route.php @@ -139,6 +139,8 @@ public function __debugInfo() * * @param string $pattern URL pattern. * @return self New route instance. + * + * @deprecated Use `new Router()` instead. */ public static function get(string $pattern): self { @@ -150,6 +152,8 @@ public static function get(string $pattern): self * * @param string $pattern URL pattern. * @return self New route instance. + * + * @deprecated Use `new Router()` instead. */ public static function post(string $pattern): self { @@ -161,6 +165,8 @@ public static function post(string $pattern): self * * @param string $pattern URL pattern. * @return self New route instance. + * + * @deprecated Use `new Router()` instead. */ public static function put(string $pattern): self { @@ -172,6 +178,8 @@ public static function put(string $pattern): self * * @param string $pattern URL pattern. * @return self New route instance. + * + * @deprecated Use `new Router()` instead. */ public static function delete(string $pattern): self { @@ -183,6 +191,8 @@ public static function delete(string $pattern): self * * @param string $pattern URL pattern. * @return self New route instance. + * + * @deprecated Use `new Router()` instead. */ public static function patch(string $pattern): self { @@ -194,6 +204,8 @@ public static function patch(string $pattern): self * * @param string $pattern URL pattern. * @return self New route instance. + * + * @deprecated Use `new Router()` instead. */ public static function head(string $pattern): self { @@ -205,6 +217,8 @@ public static function head(string $pattern): self * * @param string $pattern URL pattern. * @return self New route instance. + * + * @deprecated Use `new Router()` instead. */ public static function options(string $pattern): self { @@ -213,6 +227,8 @@ public static function options(string $pattern): self /** * @param string[] $methods + * + * @deprecated Use `new Router()` instead. */ public static function methods(array $methods, string $pattern): self { diff --git a/src/RouteCollector.php b/src/RouteCollector.php index 7c4b959..b0d5d3d 100644 --- a/src/RouteCollector.php +++ b/src/RouteCollector.php @@ -8,6 +8,8 @@ /** * Simple route collector that manages routes, groups, and middleware definitions. + * + * @deprecated Will be removed in the next major release. */ final class RouteCollector implements RouteCollectorInterface { diff --git a/src/RouteCollectorInterface.php b/src/RouteCollectorInterface.php index dca8742..05ab352 100644 --- a/src/RouteCollectorInterface.php +++ b/src/RouteCollectorInterface.php @@ -6,6 +6,8 @@ /** * Interface for route collectors that manage route registration. + * + * @deprecated Will be removed in the next major release. */ interface RouteCollectorInterface {