League URI Interfaces
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
This package contains an interface to represents URI objects according to RFC 3986.
$ composer require league/uri-interfaces
UriInterfaceinterface models generic URIs as specified in RFC 3986. The interface provides methods for interacting with the various URI parts, which will obviate the need for repeated parsing of the URI. It also specifies:
__toString()method for casting the modeled URI to its string representation.
jsonSerialize()method to improve interoperability with WHATWG URL Living standard
UriInterfaceinterface defines the following methods to access the URI string representation, its individual parts and components.
Modifying URI properties
TheUriinterface defines the following modifying methods. these methods must be implemented such that they retain the internal state of the current instance and return an instance that contains the changed state.
Delimiter characters are not part of the URI component and must not be added to the modifying method submitted value. If present they will be treated as part of the URI component content.
These methods will trigger aLeague\Uri\Contract\UriExceptionexception if the resulting URI is not valid. The validation is scheme dependent.
Relation with PSR-7
This interface exposes the same methods asPsr\Http\Message\UriInterface. But, differs on the following keys:
httpsschemes to be supported.
httpsschemes specific validation rules.
UriComponentInterfaceinterface models generic URI components as specified in RFC 3986. The interface provides methods for interacting with an URI component, which will obviate the need for repeated parsing of the URI component. It also specifies a
__toString()method for casting the modeled URI component to its string representation.
UriComponentInterfaceinterface defines the following methods to access the URI component content.
Modifying URI properties
TheUriComponentInterfaceinterface defines the following modifying method. this method must be implemented such that it retains the internal state of the current instance and return an instance that contains the changed state.
UriComponentInterface extended interfaces
Because each URI component has specific needs most have specialized interface which all extends theUriComponentInterfaceinterface. The following interfaces also exist:
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.