Add Resource::isMethodAllowed() #18

Open
opened 2026-06-29 15:42:27 +02:00 by c.fahner · 0 comments
Owner

Resource's should explicitly opt-in to runtime checking of allowed HTTP methods. A separate interface (name not yet settled) declares a method isMethodAllowed(lowercase-string&non-empty-string):bool, which is checked before the HTTP method is executed.

This removes null from the return type hint of HTTP method declarations.

Adds Endpoint\Method::isAllowed():bool. For GET, HEAD, and OPTIONS this method should always return true.

`Resource`'s should explicitly opt-in to runtime checking of allowed HTTP methods. A separate interface (name not yet settled) declares a method `isMethodAllowed(lowercase-string&non-empty-string):bool`, which is checked before the HTTP method is executed. This removes `null` from the return type hint of HTTP method declarations. Adds `Endpoint\Method::isAllowed():bool`. For GET, HEAD, and OPTIONS this method should always return `true`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
slendium/framework#18
No description provided.