summaryrefslogtreecommitdiff
path: root/src/Route.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Route.php')
-rw-r--r--src/Route.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Route.php b/src/Route.php
new file mode 100644
index 0000000..1a9ad03
--- /dev/null
+++ b/src/Route.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Lightscale\Router;
+
+use Closure;
+use Lightscale\Router\Enums\HttpMethod;
+
+class Route
+{
+ protected Closure $handler;
+
+ public function __construct(
+ protected PathSegment $segment,
+ protected HttpMethod $method,
+ callable $handler,
+ ) {
+ $this->handler = Closure::fromCallable($handler);
+ }
+}