Initial Version
This commit is contained in:
30
core/lib/Routing/Route.php
Normal file
30
core/lib/Routing/Route.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace KTXC\Routing;
|
||||
|
||||
/**
|
||||
* Value object representing a resolved route.
|
||||
*/
|
||||
class Route
|
||||
{
|
||||
/** @var array<string, string> Route parameters extracted from path */
|
||||
public array $params = [];
|
||||
|
||||
public function __construct(
|
||||
public readonly string $name,
|
||||
public readonly string $method,
|
||||
public readonly string $path,
|
||||
public readonly bool $authenticated,
|
||||
public readonly string $className,
|
||||
public readonly string $classMethodName,
|
||||
public readonly array $classMethodParameters = [],
|
||||
public readonly array $permissions = [],
|
||||
) {}
|
||||
|
||||
public function withParams(array $params): self
|
||||
{
|
||||
$clone = clone $this;
|
||||
$clone->params = $params;
|
||||
return $clone;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user