summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Light <sam@lightscale.co.uk>2026-06-10 19:00:32 +0100
committerSam Light <sam@lightscale.co.uk>2026-06-10 19:00:32 +0100
commitf71632bacf15cffc3c1a0f1d4673f04c9e8e3f55 (patch)
treef816dbd8867a593c6239dd264b7114ba1c70643f /src
parent5028ab476d3e262956cef65147e279b7922bb53d (diff)
added regex matcher to path segment type and test
Diffstat (limited to 'src')
-rw-r--r--src/Enums/PathSegmentType.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Enums/PathSegmentType.php b/src/Enums/PathSegmentType.php
index 6547842..43113e6 100644
--- a/src/Enums/PathSegmentType.php
+++ b/src/Enums/PathSegmentType.php
@@ -9,4 +9,12 @@ enum PathSegmentType
case Raw;
case Root;
case Parameter;
+
+ public function routeMatchRegex(): ?string
+ {
+ return match ($this) {
+ self::Parameter => '/{([a-zA-Z0-9-_]+)}/',
+ default => null,
+ };
+ }
}