Name: uri-interfaces
Owner: The League of Extraordinary Packages
Description: League URI Interfaces
Created: 2016-10-17 11:46:56.0
Updated: 2018-05-22 13:09:34.0
Pushed: 2018-05-22 12:11:28.0
Homepage: http://uri.thephpleague.com
Size: 33
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This package contains an interface to represents URI objects according to RFC 3986.
You need:
mposer require league/uri-interfaces
The Uri
interface 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 a __toString()
method for casting the modeled URI to its string representation.
The Uri
interface defines the following methods to access the URI string representation, its individual parts and components.
p
ic Uri::__toString(): string
ic Uri::getScheme(void): string
ic Uri::getUserInfo(void): string
ic Uri::getHost(void): string
ic Uri::getPort(void): int|null
ic Uri::getAuthority(void): string
ic Uri::getPath(void): string
ic Uri::getQuery(void): string
ic Uri::getFragment(void): string
The Uri
interface 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 a InvalidArgumentException
exception if the resulting URI is not valid. The validation is scheme dependent.
p
ic Uri::withScheme(string $scheme): self
ic Uri::withUserInfo(string $user [, string $password = null]): self
ic Uri::withHost(string $host): self
ic Uri::withPort(int|null $port): self
ic Uri::withPath(string $path): self
ic Uri::withQuery(string $query): self
ic Uri::withFragment(string $fragment): self
This interface exposes the same methods as Psr\Http\Message\UriInterface
. But, unlike the UriInterface
, this interface does not require the http
and https
schemes to be supported. The supported schemes are determined by the each concrete implementation.
Contributions are welcome and will be fully credited. Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email nyamsprod@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.