Added
League\Uri\Urnobject to specifically work with URN as defined by RFC8141Http::tryNewreturns a newUriinstance on success or null on failure (ie: a Relax version ofHttp::new).Http::whenconditional method to ease component building logic.Uri::parsereturns a newUriinstance on success or null on failure (ie: a Relax version ofUri::fromBaseUriandUri::new) that mimics the behaviour of the upcoming native PHP URI parse method.Uri::tryNewreturns a newUriinstance on success or null on failure (ie: a Relax version ofUri::new).Uri::whenconditional method to ease component building logic.Uri::isOpaquetells whether the URI is opaque or not.Uri::isAbsolutetells whether the URI is absolute or not.Uri::isNetworkPathtells whether the URI is a network path.Uri::isAbsolutePathtells whether the URI is an absolute path.Uri::isRelativePathtells whether the URI is a relative path.Uri::isSameDocumenttells whether both URIs refer to the same document.Uri::equalstells whether both URIs refer to the same document (allows taking into account the fragment component)Uri::isLocalFiletells whether thefilescheme base URI represents a local file.Uri::isCrossOrigintells whether two URI do not share the same origin.Uri::isSameOrigintells whether two URI share the same origin.Uri::getOriginreturns the URI origin as described in the WHATWG URL Living standard specification.Uri::toDisplayStringreturns the human-readable string representation of the URI as an IRI.Uri::toRfc8089The method will return null if the URI scheme is not thefileschemeUri::resolvereturns a newUriinstance resolve against the current instance.Uri::normalizereturns a newUriinstance with a full “normalized-decoded” representation: The URI is normalized (when applicable), and components are percent-decoded. Normalization may contain destructive operation.Uri::withUsernamereturns a newUriinstance with the updated username component.Uri::withPasswordreturns a newUriinstance with the updated password component.Uri::toAsciiStringreturns the URI string representation as per RFC3986Uri::toAsciiStringreturns the URI string representation as per RFC3987 with the host in Unicode form if availableUri::getUnicodeHostreturns the host in Unicode form if available; fallback to its RFC3986 representation otherwiseUriTemplateimplements theStringableinterfaceUriTemplate::expandToUriandUriTemplate::expandToUriOrFailUriTemplate::expandToUrlandUriTemplate::expandToUrlOrFailUriTemplate::expandToPsr7UriandUriTemplate::expandToPsr7UriOrFailUriTemplate::expandandUriTemplate::expandOrFailtake a second optional parameter which represents a base URI to resolve the URI from.- Dependency to
psr/http-factorypackage which is required for the package. - Support for
Uri\Rfc3986\UriandUri\Whatwg\Url
Fixed
UserInfonow can be constructed and mutated even when theusercomponent is not present. It was silently ignored.UriandHttpnormalization normalized IP against RFC3986 rules and not WHATWG rules.Uri::getOriginnow follows WHATWG cross-origin definitionUrihost encoding compliance to RFC3986 is improved by supporting RFC3986 encoded URI properlyUriparsing with strings started or ended with empty string are no longer allowedUrispace are rawurlencoded.Urivalidatesurnas per RFC 8141Urivalidatesmailtoscheme as per RFC 6068Urivalidatesblobscheme as per Blob DefinitionUri::getPathno longer trim the leading slashes (theHttpclass which is a PSR-7 compliant class still do!)
Deprecated
BasUriuse theUriclass or the uri-componentModifierclass depending on your requirements.
Removed
- None