final class ApiEndpointRequestResolver (View source)

Maps an incoming request under the configured API prefix to canonical endpoint metadata.

Methods

__construct(ApiEndpointRegistry $endpoints, ApiConfig $config, ApiRoutePathResolver $pathResolver = new ApiRoutePathResolver())

Binds request matching to the resolved API prefix and endpoint registry.

resolve(ServerRequestInterface $request)

Returns the matching endpoint, or null for paths outside the API prefix or registry.

Details

__construct

__construct(ApiEndpointRegistry $endpoints, ApiConfig $config, ApiRoutePathResolver $pathResolver = new ApiRoutePathResolver())

Binds request matching to the resolved API prefix and endpoint registry.

Parameters

ApiEndpointRegistry $endpoints
ApiConfig $config
ApiRoutePathResolver $pathResolver

resolve

ApiEndpoint|null resolve(ServerRequestInterface $request)

Returns the matching endpoint, or null for paths outside the API prefix or registry.

Parameters

ServerRequestInterface $request

Return Value

ApiEndpoint|null