Skip to content

RequestDtoRegistry

In-process cache for #[MapRequest] reflection results, mirroring Quiote\DI\Container::classPlan()‘s per-class caching style: a DTO’s shape never changes mid-process, so both the parsed RequestDtoDefinition and the “which execute*() parameter (if any) is a #[MapRequest] DTO” lookup are computed once and reused for the life of the worker/request.

Unlike the routing module’s directory-wide scan, this reflects one class at a time, so no filesystem-artifact pipeline is warranted here.

final class RequestDtoRegistry

Since1.0.0
SourceRequest/RequestDtoRegistry.php
MethodDescription
definitionFor(string $dtoClass): RequestDtoDefinitionThe parsed definition for a #[MapRequest] DTO, reflected on first request and then served from the in-process cache for the life of the worker.
dtoClassForMethod(class-string $actionClass, string $methodName): ?stringThe #[MapRequest] DTO class bound to the named action method’s parameter list, or null if that method has none.

public static function definitionFor(string $dtoClass): RequestDtoDefinition

The parsed definition for a #[MapRequest] DTO, reflected on first request and then served from the in-process cache for the life of the worker.

ParameterTypeDescription
$dtoClassstring

Returns RequestDtoDefinition

public static function dtoClassForMethod(class-string $actionClass, string $methodName): ?string

The #[MapRequest] DTO class bound to the named action method’s parameter list, or null if that method has none.

ParameterTypeDescription
$actionClassclass-string
$methodNamestring

Returns ?``string