diff options
Diffstat (limited to 'src/Enums/PathSegmentType.php')
| -rw-r--r-- | src/Enums/PathSegmentType.php | 8 |
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, + }; + } } |
