thephpleague/uri-interfaces

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Uri Interfaces

This package contains an interface to represents URI objects according to RFC 3986.

System Requirements

You need:

Install
mposer require league/uri-interfaces
Documentation
League\Uri\Interfaces\Uri

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.

Accessing URI properties

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
Modifying URI properties

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
Relation with PSR-7

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.

Contributing

Contributions are welcome and will be fully credited. Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email nyamsprod@gmail.com instead of using the issue tracker.

Credits
License

The MIT License (MIT). Please see License File for more information.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.