Skip to content

Commit

Permalink
Merge branch '6.x' of github.com:thephpleague/route into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
philipobenito committed Nov 20, 2024
2 parents 1926646 + 90a58b4 commit 5004f22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions src/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class Route implements

protected $handler;

/**
* @param array<string>|string $method
* @param array<string> $vars
*/
public function __construct(
protected array|string $method,
protected string $path,
Expand Down Expand Up @@ -66,6 +70,7 @@ public function getCallable(?ContainerInterface $container = null): callable
return $callable;
}

/** @return array<string>|string */
public function getMethod(): array|string
{
return $this->method;
Expand All @@ -87,6 +92,7 @@ public function getPath(array $replacements = []): string
return preg_replace(array_keys($toReplace), array_values($toReplace), $this->path);
}

/** @return array<string> */
public function getVars(): array
{
return $this->vars;
Expand Down Expand Up @@ -119,6 +125,7 @@ public function setParentGroup(RouteGroup $group): self
return $this;
}

/** @param array<string> $vars */
public function setVars(array $vars): self
{
$this->vars = $vars;
Expand Down

0 comments on commit 5004f22

Please sign in to comment.