chore: lots of changes

This commit is contained in:
2025-05-24 07:09:22 +02:00
parent 77ee769d5e
commit 899227b0a4
178 changed files with 5145 additions and 53 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Framework\Router;
final class RouteCollection
{
/** @var array<string, array{static: array<string, callable>, dynamic: array<array{regex: string, handler: callable}>}> */
private array $routes;
public function __construct(array $routes) {
$this->routes = $routes;
}
public function getStatic(string $method): array {
return $this->routes[$method]['static'] ?? [];
}
public function getDynamic(string $method): array {
return $this->routes[$method]['dynamic'] ?? [];
}
public function has(string $method): bool {
return isset($this->routes[$method]);
}
}