ApiEndpointRegistry
final class ApiEndpointRegistry (View source)
Owns the canonical ordered API endpoint set and enforces unique names and method-path pairs.
Methods
Normalizes, validates and registers one endpoint.
Registers a GET endpoint with the supplied access and metadata policy.
Registers a POST endpoint with the supplied access and metadata policy.
Registers a PUT endpoint with the supplied access and metadata policy.
Registers a PATCH endpoint with the supplied access and metadata policy.
Registers a DELETE endpoint with the supplied access and metadata policy.
Returns the endpoint registered under the exact name, or null when none exists.
Performs an exact definition lookup, with HEAD falling back to a matching GET definition.
Returns endpoints in their registration order.
Details
add
ApiEndpoint
add(string $method, string $path, ControllerAction $controllerAction, string $name, string $summary, string $description, ApiAccess $access = ApiAccess::Protected, ApiEndpointMetadata|null $metadata = null)
Normalizes, validates and registers one endpoint.
get
ApiEndpoint
get(string $path, ControllerAction $controllerAction, string $name, string $summary, string $description, ApiAccess $access = ApiAccess::Protected, ApiEndpointMetadata|null $metadata = null)
Registers a GET endpoint with the supplied access and metadata policy.
post
ApiEndpoint
post(string $path, ControllerAction $controllerAction, string $name, string $summary, string $description, ApiAccess $access = ApiAccess::Protected, ApiEndpointMetadata|null $metadata = null)
Registers a POST endpoint with the supplied access and metadata policy.
put
ApiEndpoint
put(string $path, ControllerAction $controllerAction, string $name, string $summary, string $description, ApiAccess $access = ApiAccess::Protected, ApiEndpointMetadata|null $metadata = null)
Registers a PUT endpoint with the supplied access and metadata policy.
patch
ApiEndpoint
patch(string $path, ControllerAction $controllerAction, string $name, string $summary, string $description, ApiAccess $access = ApiAccess::Protected, ApiEndpointMetadata|null $metadata = null)
Registers a PATCH endpoint with the supplied access and metadata policy.
delete
ApiEndpoint
delete(string $path, ControllerAction $controllerAction, string $name, string $summary, string $description, ApiAccess $access = ApiAccess::Protected, ApiEndpointMetadata|null $metadata = null)
Registers a DELETE endpoint with the supplied access and metadata policy.
findByName
ApiEndpoint|null
findByName(string $name)
Returns the endpoint registered under the exact name, or null when none exists.
findByRequest
ApiEndpoint|null
findByRequest(string $method, string $path)
Performs an exact definition lookup, with HEAD falling back to a matching GET definition.
This operation does not implement Router matching and must not authorize an incoming request; request security uses ApiEndpointRequestResolver with the canonical RouteMatch instead.
all
array
all()
Returns endpoints in their registration order.