Skip to content

ActionResolver

Resolves which execute* method to call and invokes action, returning raw view token.

Single place where that selection happens, shared by top-level dispatch and slot rendering.

class ActionResolver

SourceExecution/ActionResolver.php
MethodDescription
candidateMethodNames(string $requestMethod): array<int, string>Try exact, then canonicalized (e.g.
execute(Action $action, string $requestMethod, ServerRequestInterface $request): mixedExecute an action selecting execute() fallback to execute().
resolveMethodName(Action $action, string $requestMethod): ?stringThe first execute*() method name this action actually implements for the given HTTP verb, or null if none match (mirrors the candidate resolution execute() itself uses, without the execute()/default-view fallbacks — callers needing that fallback should use execute()).

public static function candidateMethodNames(string $requestMethod): array<int, string>

Try exact, then canonicalized (e.g.

POST -> Post), then semantic mapping (GET -> Read, POST -> Write). Semantic mapping is driven by HttpMethodMapper (configurable via the routing.http_method_map setting) so every call site agrees. Default: GET/HEAD/OPTIONS/TRACE -> Read, POST -> Write, PUT/PATCH -> Update, DELETE -> Remove.

ParameterTypeDescription
$requestMethodstring

Returns array``<``int``, ``string``>

public function execute(Action $action, string $requestMethod, ServerRequestInterface $request): mixed

Execute an action selecting execute() fallback to execute().

ParameterTypeDescription
$actionAction
$requestMethodstringe.g. GET/POST canonicalized to ucfirst form?
$requestServerRequestInterface

Returns mixed — Raw view token returned by action (string|array|View::NONE).

public static function resolveMethodName(Action $action, string $requestMethod): ?string

The first execute*() method name this action actually implements for the given HTTP verb, or null if none match (mirrors the candidate resolution execute() itself uses, without the execute()/default-view fallbacks — callers needing that fallback should use execute()).

ParameterTypeDescription
$actionAction
$requestMethodstring

Returns ?``string