Skip to content

Internals Router Interface IMethodPolicy

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

router\interface\IMethodPolicy

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/router/interface/IMethodPolicy.php · Snapshot 8411f4287706.

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

IMethodPolicy

Declaration and architectural role

interface IMethodPolicy

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
normalize public function normalize(string $method): string
isSafe public function isSafe(string $method): bool
allows public function allows(string $routeMethod, string $requestMethod): bool
allowed public function allowed(string $routeMethod): array

normalize

Source line 7

public function normalize(string $method): string;

Parameters

Parameter Type, modifiers and default Purpose
$method string $method HTTP method token; validation/normalization follows the method policy.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

isSafe

Source line 8

public function isSafe(string $method): bool;

Parameters

Parameter Type, modifiers and default Purpose
$method string $method HTTP method token; validation/normalization follows the method policy.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

allows

Source line 9

public function allows(string $routeMethod, string $requestMethod): bool;

Parameters

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

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

allowed

Source line 10

public function allowed(string $routeMethod): array;

Parameters

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

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

Clone this wiki locally