Request-Interop Now Open For Public Review
After an extensive period of untagged private review, the Request-Interop standard interface package is now open for public review.
Request-Interop provides an interoperable package of standard interfaces for encapsulating readable server-side request values in PHP 8.4 or later, in order to reduce the global mutable state problems that exist with PHP superglobals. It reflects, refines, and reconciles the common practices identified within several pre-existing projects to define these interfaces:
- RequestStruct to represent the incoming request.
- RequestStructFactory to create RequestStruct instances.
Request-Interop also defines a marker interface, RequestThrowable, for marking an Exception as request-related.
Finally, Request-Interop defines a RequestTypeAliases interface with PHPStan types to aid static analysis.
The reference implementations demonstrate how the interfaces can be used.
If you have to deal with server-side requests and are interested an interoperable set of interfaces, please offer your comments and criticism as issues or PRs out at Github.