From b02ea12e43f95f5e3911e56d347775cc2a4a648f Mon Sep 17 00:00:00 2001 From: Marek Skopal Date: Thu, 3 Oct 2024 23:55:23 +0200 Subject: [PATCH 1/2] Update psr/http-message to 2.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3d6d622..74c6c35 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "nikic/fast-route": "^1.3", "psr/container": "^2.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0.1", + "psr/http-message": "^1.1|^2.0", "psr/http-server-handler": "^1.0.1", "psr/http-server-middleware": "^1.0.1", "opis/closure": "^3.6.3", From b613604660f79aa9bbbc91285ad5193679080d3e Mon Sep 17 00:00:00 2001 From: Marek Skopal Date: Mon, 18 Nov 2024 21:39:45 +0100 Subject: [PATCH 2/2] Add array typehint --- src/Route.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Route.php b/src/Route.php index 82ba8b2..4a7af6a 100644 --- a/src/Route.php +++ b/src/Route.php @@ -25,6 +25,10 @@ class Route implements protected $handler; + /** + * @param array|string $method + * @param array $vars + */ public function __construct( protected array|string $method, protected string $path, @@ -66,6 +70,7 @@ public function getCallable(?ContainerInterface $container = null): callable return $callable; } + /** @return array|string */ public function getMethod(): array|string { return $this->method; @@ -87,6 +92,7 @@ public function getPath(array $replacements = []): string return preg_replace(array_keys($toReplace), array_values($toReplace), $this->path); } + /** @return array */ public function getVars(): array { return $this->vars; @@ -119,6 +125,7 @@ public function setParentGroup(RouteGroup $group): self return $this; } + /** @param array $vars */ public function setVars(array $vars): self { $this->vars = $vars;