Uri-Interop Now Open For Public Review
After a period of private review, the uri-interop/interface package is now open for public review.
Uri-Interop publishes a standard set of interoperable URI interfaces for PHP 8.4+. It reflects, refines, and reconciles the common practices identified within several pre-existing projects.
The package defines separate interfaces to afford reading and modifying URI component values:
-
UriStringableComponents affords reading of the URI component values and recomposing them into a string. -
MutableUriMutableComponents extendsUriStringableComponents to afford direct modification of component values. -
ImmutableUriImmutableComponents extendsUriStringableComponents to afford immutable modification of component values.
Uri-Interop defines factory and parser interfaces:
-
UriFactoryUriEncodedFactory affords creating a new URI instance from URI component values. -
UriParserUriEncodedParser affords creating a new URI instance from a URI string.
Uri-Interop defines these marker interfaces to codify expectations around RFC compliance:
-
Rfc3986CompliantUriEncoded marks any of the other interfaces to indicate RFC 3986 compliance. -
Rfc3987CompliantIriEncoded marks any of the other interfaces to indicate RFC 3987 compliance.
Finally, Uri-Interop defines an interface of PHPStan type aliases, UriTypeAliases, to aid static analysis.
If you use URI objects (who doesn't!) and are interested an interoperable set of interfaces, please offer your comments and criticism as issues or pull requests out at Github.
UPDATE (Mon 17 Mar 2025): Based on review, some of the interface names have changed since the initial announcement, though their purpose remains the same.