class RouteParser

Parses route strings:

"/user/{name}[/{id:[0-9]+}]"

Constants

VARIABLE_REGEX

DEFAULT_DISPATCH_REGEX

Methods

static array
parse(string $routePattern)

Parse route pattern

static array
parsePlaceholders(string $route)

Parses a route string that does not contain optional segments.

static string
createRegex(array|string $routeData)

Create route regex

static array
buildRegexForRoute(array $routeData)

Create route regex

static bool
regexHasCapturingGroups(string $regex)

Test for capturing groups

static bool
isStaticRoute(array $routeData)

Return true if route is static

Details

at line 39
static array parse(string $routePattern)

Parse route pattern

Parameters

string $routePattern

Return Value

array

at line 72
static array parsePlaceholders(string $route)

Parses a route string that does not contain optional segments.

Parameters

string $route

Return Value

array

at line 107
static string createRegex(array|string $routeData)

Create route regex

Parameters

array|string $routeData

Return Value

string

at line 124
static array buildRegexForRoute(array $routeData)

Create route regex

Parameters

array $routeData

Return Value

array

at line 156
static bool regexHasCapturingGroups(string $regex)

Test for capturing groups

Parameters

string $regex

Return Value

bool

at line 185
static bool isStaticRoute(array $routeData)

Return true if route is static

Parameters

array $routeData

Return Value

bool