ApiRoutePathResolver
final class ApiRoutePathResolver (View source)
Applies the shared normalization rules used for API prefixes, routes and request matching.
Methods
Converts a root prefix to an empty prefix and removes surrounding or trailing slashes otherwise.
Produces an absolute normalized path while preserving the root path.
Joins an API prefix and endpoint-relative path using canonical slash rules.
Removes the matching API prefix, returning null when the request lies outside that boundary.
Details
normalizePrefix
string
normalizePrefix(string $prefix)
Converts a root prefix to an empty prefix and removes surrounding or trailing slashes otherwise.
normalizePath
string
normalizePath(string $path)
Produces an absolute normalized path while preserving the root path.
compose
string
compose(string $prefix, string $path)
Joins an API prefix and endpoint-relative path using canonical slash rules.
resolveRequestPath
string|null
resolveRequestPath(string $prefix, string $requestPath)
Removes the matching API prefix, returning null when the request lies outside that boundary.