Skip to content

Internals Router Response RouteResponseFactory

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

router\response\RouteResponseFactory

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/router/response/RouteResponseFactory.php · Snapshot 8411f4287706.

Routing separates definition, HTTP request snapshot, matching, method policy, execution and error responses. Collaborators can be replaced through constructor injection.

Imports and dependencies

use response\Response;
use router\interface\IRouteResponseFactory;

RouteResponseFactory

Declaration and architectural role

final class RouteResponseFactory implements IRouteResponseFactory

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

Method Signature
notFound public function notFound(): Response
methodNotAllowed public function methodNotAllowed(array $allowed): Response
csrfRejected public function csrfRejected(): Response

notFound

Source line 10

public function notFound(): Response

Return expressions (including local callbacks): Response::make(404, 'Not Found')->asHtml().

Implementation, validation guards and interaction order
public function notFound(): Response
    {
        return Response::make(404, 'Not Found')->asHtml();
    }

methodNotAllowed

Source line 15

public function methodNotAllowed(array $allowed): Response

Parameters

Parameter Type, modifiers and default Purpose
$allowed array $allowed Operation input; the exact use, validation and propagation are shown in the implementation trace.

Return expressions (including local callbacks): Response::make(405, 'Method Not Allowed') ->header('Allow', implode(', ', $allowed))->asJson().

External effects include header.

Implementation, validation guards and interaction order
public function methodNotAllowed(array $allowed): Response
    {
        return Response::make(405, 'Method Not Allowed')
            ->header('Allow', implode(', ', $allowed))->asJson();
    }

csrfRejected

Source line 21

public function csrfRejected(): Response

Return expressions (including local callbacks): Response::make(403, 'Invalid CSRF token')->asJson().

Implementation, validation guards and interaction order
public function csrfRejected(): Response
    {
        return Response::make(403, 'Invalid CSRF token')->asJson();
    }

Related types

Clone this wiki locally