All Notable changes to League\Uri\Components will be documented in this file
7.8.1 - 2026-03-16
- None
- Update requirement to use
uri7.8.1
- None
- None
7.8.0 - 2026-01-16
- Added support for
BackedEnum Query::hasListQuery::getListQuery::withListQuery::appendListQuery::withoutListQuery::withoutListsQuery::onlyListsQuery::countDistinctKeysQuery::isNotEmptyQuery::mapQuery::filterQuery::indexOfValueQuery::valueAtQuery::keyAtQuery::pairURLSearchParams::countDistinctKeysURLSearchParams::tapDomain::isSubdomainOfDomain::hasSubdomainDomain::isSiblingOfDomain::parentHosDomain::commonAncestorWith- Added
transformmethod to Immutable classes
QueryandModifiermethods can opt to switch to different query string extraction using the new$extractModeparameter.QueryandModifiermethods can opt to switch to different query string composition using the new$composeModeparameter.QueryandModifiermethods can opt to switch to different type coercion using the new$coercionModeparameter.
URLSearchParams::uniqueKeyCountuseURLSearchParams::countDistinctKeysinstead
- None
7.7.0 - 2025-12-08
Domain::firstreturns the first domain labelDomain::lastreturns the last domain labelDomain::containstells wether the label is present in the domainDomain::indexOfreturns the index of the first occurrence of the labelDomain::lastIndexOfreturns the index of the last occurrence of the labelDomain::isEmptytells whether the domain is empty or not (contains at least on label)HierarchicalPath::firstreturns the first segmentHierarchicalPath::lastreturns the last segmentHierarchicalPath::containstells whether the segment is present in the pathHierarchicalPath::indexOfreturns the index of the first occurrence of the segmentHierarchicalPath::lastIndexOfreturns the index of the last occurrence of the segmentHierarchicalPath::isEmptytells whether the path is empty or not (contains at least on segment)Query::firstreturns the first value for a given query key pairQuery::lastreturns the last value for a given query key pairQuery::isEmptytells whether the query is empty or notURLSearchParams::firstreturns the first value for a given query key pairURLSearchParams::lastreturns the last value for a given query key pairURLSearchParams::hasValuean alias of usingURLSearchParams::haswith 2 parametersURLSearchParams::deleteValuean alias of usingURLSearchParams::deletewith 2 parametersModifier::redactUserInforedacts the user info component if presentModifier::redactPathSegmentsredacts specific path segments if presentModifier::redactPathNextSegmentsredacts specific path next segments if presentModifier::redactPathSegmentsByOffsetredacts specific path segments by offset if presentModifier::redactQueryPairsredacts specific query pair if presentModifier::prependQueryprepend a query string to the URI query componentModifier::prependPathreplaceModifier::prependSegmentModifier::appendPathreplaceModifier::appendSegmentModifier::prependSegmentsModifier::appendSegments
- Fix deprecation message for
Modifier::uri()method 166 by meyerbaptiste - Fix missing
SensitiveParameterusage onModifier::withUserInfomethod - Fix Host resolution using the new
HostRecordclass - Fix
Modifier::withPathimprove handling of path leading slash presence for PSR-7 implementing classes
Modifier::prependSegmentuseModifier::prependPathinsteadModifier::appendSegmentuseModifier::appendPathinstead
- None
7.6.0 - 2025-11-18
UriComponentInterface::equalsmethodFragmentDirectivessupportComponent::whenconditional method to ease component building logic.URLSearchParams::whenconditional method to ease component building logic.Modifier::prependQueryParametersreturns a modifier with prepended query parametersModifier::replaceQueryParameterreturns a modifier with part of its query string replacedModifier::replaceQueryPairreturns a modifier with part of its query string replacedModifier::whenconditional method to ease component building logic.Modifier::normalizeIpreturns the host normalized for IPv6 and IPv4 addressesModifier::normalizeHostreturns the host as normalized by the WHATWG algorithmModifier::with*method from the underlyingUriobject are proxy to improve DX.Modifier::wrapstatic method which wraps the underlying URI object used by the Modifier class.Modifier::unwrapmethod which returns the underlying URI object used by the Modifier class.Modifier::prefixQueryPairsandModifier::prefixQueryParametersto prefix Query using the pair key or the parameter namesModifier::toMarkdownAnchorreturns the Markdown string representation of the anchor tag with the current instance as its href attribute.Modifier::toHtmlAnchorreturns the HTML string representation of the anchor tag with the current instance as its href attribute.tryNewnamed constructor added to all classes to return a new instance on success ornullon failure.Query::decodedthe string representation of the component decoded.Query::normalizedQuery::fromPairsandQuery::fromVariabletakes a optional$prefixparameter to update the query pair keys or parameter namesQuery::indexOfandQuery::replaceQuery::mergeParametersQuery::replaceParameterQuery::replacePairQuery::prependURLSearchParams::decodedthe string representation of the component decoded.Path::nornalizedFragment::normalizedHierarchicalPath::normalizedDatapath::normalized- Support for
Uri\Rfc3986\Uri - Support for
Uri\WhatWg\Url Port::defaultSchemesPort::defaultSchemeScheme::isWhatWgSpecialScheme::defaultPortScheme::hasDefaultPort
Modifierhost related method return host in IDN form or ASCII form depending on the URI input formatUserInfonow can be constructed and mutated even when theusercomponent is not present. It was throwing an exception before.
Modifier::getIdnUriStringuseModifier::toDisplayStringinsteadModifier::getUriStringuseModifier::toStringinsteadModifier::getUriuseModifier::uriinsteadModifier::fromuseModifier::wrapinstead
- None
7.5.0 - 2024-12-08
UrlSearchParams::uniqueKeyCountModifier::getIdnUriStringModifier::hostToIpv6CompressedModifier::hostToIpv6ExpandedScheme::isHttpScheme::isWebsocketScheme::isSslScheme::isSpecial- Using PHP8.4
Deprecatedattribute to signal deprecated public API methods and constants. Host::encodedmethod to raw url encode the host
- Remove Usage of PSR-7
UriInterfaceinUrlSearchParamsclass - Normalizes
fromUrito return the same value for the component if the URI object has the same string representation.
- Usage of PSR-7
UriFactoryInterfaceis deprecated inModifierclass
- None
7.4.1 - 2024-02-23
- None
- Fix package to avoid PHP8.4 deprecation warnings
- Bug Fix
removeEmptyPairs#133
- None
- None
7.4.0 - 2023-12-01
Query::fromVariableUrlSearchParams::fromVariable
- None
Query::fromParametersuseQuery::fromVariableinsteadUrlSearchParams::fromParametersuseUrlSearchParams::fromVariableinstead
- None
7.3.0 - 2023-09-09
League\Uri\Modifier::removeQueryPairsByKeyLeague\Uri\Modifier::removeQueryPairsByValueLeague\Uri\Modifier::removeQueryPairsByKeyValueLeague\Uri\Components\Query::hasPairLeague\Uri\Components\Query::withoutPairByKeyLeague\Uri\Components\Query::withoutPairByValueLeague\Uri\Components\Query::withoutPairByKeyValueLeague\Uri\Components\Query::fromFormDataLeague\Uri\Components\Query::toFormDataLeague\Uri\Components\URLSearchParams
League\Uri\Components\Query::sortto improve WHATWG compliance.League\Uri\QueryString::buildFromPairsshould throwSyntaxErrorinstead ofTypeErrorLeague\Uri\Components\Queryuses internallyLeague\Uri\KeyValuePair\ConverterLeague\Uri\Components\Query::toRFC3986is no longer deprecatedLeague\Uri\Components\Query::jsonSerualizeusestoFormDatainstead oftoRFC1738League\Uri\Components\Queryfix float handling.- Exception message typo fix #121 by GrahamCampbell
League\Uri\Modifier::removeQueryPairsuseLeague\Uri\Modifier::removeQueryPairsByKeyinstead.League\Uri\Components\Query::withoutPairuseLeague\Uri\Components\Query::withoutPairByKeyinstead.
- None
7.2.1 - 2023-08-30
- None
composer.jsonconstraints
- None
- None
7.2.0 - 2023-08-30
Modifier::appendQueryPairsModifier::mergeQueryPairsModifier::removeQueryPairsModifier::removeEmptyQueryPairsModifier::appendQueryParametersModifier::mergeQueryParametersModifier::removeQueryParametersModifier::removeQueryParametersIndices
- None
Modifier::removeParamsuseModifier::removeQueryParametersinsteadModifier::removePairsuseModifier::removeQueryPairsinsteadModifier::removeEmptyPairsuseModifier::removeEmptyQueryPairsinstead
- None
7.1.0 - 2023-08-21
Modifier::encodeQuery
- Using the
Encoderclass to normalize encoding and decoding in all packages
- None
- None
7.0.0 - 2023-08-10
valuemethod to replace the removedgetContentmethod.- requires
League\Uripackage. League\Uri\Components\Scheme::newnamed constructorLeague\Uri\Components\UserInfo::newnamed constructorLeague\Uri\Components\Host::newnamed constructorLeague\Uri\Components\Domain::newnamed constructorLeague\Uri\Components\Fragment::newnamed constructorLeague\Uri\Components\Query::newnamed constructorLeague\Uri\Components\Path::newnamed constructorLeague\Uri\Components\DataPath::newnamed constructorLeague\Uri\Components\UserInfo::withUsermodifier methodLeague\Uri\Components\UserInfo::withPassmodifier methodLeague\Uri\Components\Port::fromNumbermodifier methodLeague\Uri\Components\Query::parametersaccessing methodLeague\Uri\Components\Query::parameteraccessing methodLeague\Uri\Components\Query::hasParameteraccessing methodLeague\Uri\IPv4Calculators\MissingIPv4CalculatorexceptionLeague\Uri\Components\OffsetOutOfBoundsexception addedLeague\Uri\Modifierto replace deprecatedLeague\Uri\Modifier
- converts Value Objects properties to being
private readonlywhere possible. - All components class constructors (except for the
UserInfoand theAuthorityclasses) are made private use the available named constructors instead - Named constructors default value are removed, you need to explicitly add an argument value or use the
::new()named constructor instead. UserInfoclass makes a distinction betweennulland the empty string.Query::hasaccessing method accept a variadic parameters to check multiple keys at the same time.Domainvalue can benullor a non-empty string previously it would trigger an exceptionDomain::appendandDomain::prependrespects the root status of the instance.
- All
createFromStringnamed constructors are replaced by thenewnamed constructor. - All
createFromNullnamed constructors are replaced by thenewnamed constructor. - All remaining named constructors which starts with
createFrom*replaced by the same method starting withfrom*. For exampleAuthority::createFromUriis deprecated in favor ofAuthority::fromUri Query::paramsis replaced byQuery::parametersandQuery::parameterHierarchicalPath::segmentsuseHierarchicalPath::getIteratorinsteadDomain::labelsuseDomain::getIteratorinsteadLeague\Uri\UriModifieruseLeague\Uri\ModifierLeague\Uri\IPv4NormalizeruseLeague\Uri\Modifierinstead
- PHP7 and PHP8.0 support
withContentandgetContentmethods- Support for
__set_state - Support for
floattype as possible argument for components - Support for
inttype as possible argument for components UserInfo::withUserInfomodifier method useUserInfo::withUserand/orUserInfo::withPassinstead- Remove the
Exceptionsnamespace League\Uri\Exceptions\IPv4CalculatorMissinguseLeague\Uri\IPv4Calculators\MissingIPv4CalculatorinsteadLeague\Uri\Exceptions\OffsetOutOfBoundsuseLeague\Uri\Components\OffsetOutOfBoundsinsteadLeague\Uri\QueryStringclass. Class moved to theuri-interfacespackage.
2.4.1 - 2022-05-26
- None
- conversion query component for non ASCII characters see #202
- None
- None
Component::toStringIDNAconversion in now normalize using theUri-Interfacepackage classes
- conversion host component from ASCII to unicode no longer throw
- None
- None
Authority::createFromNullAuthority::createFromStringAuthority::createFromComponentsDataPath::createFromFilePathDataPath::createFromStringDomain::createFromStringDomain::createFromHostHierarchicalPath::createFromPathHierarchicalPath::createFromStringPath::createFromString- Support for
PHP8.0
- Fix RFC1738 encoding in
QueryString::build - Improve
UriModifierusing the newly added named constructors.
Authority::__constructreplaced byAuthoritynamed constructorsDataPath::createFromPathreplaced byDataPath::createFromFilePathDomain::__constructreplaced byDomainnamed constructorsHierarchicalPath::__constructreplaced byHierarchicalPathnamed constructors
- Support for
PHP7.2
- None
- back port improvement made to
DataUriby #154 thanks to Nicolas Grekas
- None
- None
- None
- None
- Hard dependencies on the
ext-fileinfoPHP extensions see #154 thanks Nicolas Grekas
League\Uri\UriModifier::removeEmptyPairs- to remove empty pairs from the URL object.
- Improve UserInfo decoding issue #28
- Improve processing URI object with
League\Uri\UriModifierwith a better distinction between empty and undefined URI component.
- None
- None
- None
- Improved Domain name detection according to RFC1132 see issue #27
- Normalized exception message formatting.
- None
- None
League\Uri\IPv4HostNormalizerto ease IPV4 host string normalization.League\Uri\UriModifierto ease manipulatingLeague\Uri\UriInterfaceandPsr\Http\Message\UriInterfaceimplementing objects.League\Uri\QueryStringto parse, extract and build query string and parameters- All components classes implement the
League\Uri\Contracts\ComponentInterface - All components classes expose the
createFromUrinamed constructor to instantiate a component object from a URI object League\Uri\Components\Authorityto represent the URI authority componentLeague\Uri\Components\Fragment::decodedto return the safely decoded fragment contentLeague\Uri\Components\UserInfo::decodedto return the safely decoded user info contentLeague\Uri\Components\Port::toIntto return the int representation of the Port or nullLeague\Uri\Components\Domainto better process domain hostLeague\Uri\Components\HierarchicalPath::createAbsoluteFromSegmentsLeague\Uri\Components\HierarchicalPath::createRelativeFromSegmentsLeague\Uri\Components\HierarchicalPath::segmentsto return the component segmentsLeague\Uri\Components\HierarchicalPath::getto return a specific segmentLeague\Uri\Components\Queryfollows more closely the URLSearchParams specifications from the WHATWG groupLeague\Uri\Components\Query::createFromRFC3986to return a new object from a RFC3986 query stringLeague\Uri\Components\Query::createFromRFC1738to return a new object from a RFC1738 query stringLeague\Uri\Components\Query::toRFC3986to return a RFC3986 query stringLeague\Uri\Components\Query::toRFC1738to return a RFC1738 query string
- Components classes are made
final getContentno-longer takes any parameterHostobjects throwsLeague\Uri\Exception\IdnSupportMissingon mis-configured or absent Intl extension presence.UserInfo::__constructexpects two arguments the user and the pass instead of one.Query::__constructis now private- Query parsing/building is fixed so that a round between parsing and building returns the original input.
- None
- support for
PHP7.0 - support for
PHP7.1 - support for Public Suffix List resolution
isEmptyandisNullmethods are removedLeague\Uri\parse_queryLeague\Uri\build_queryLeague\Uri\extract_queryLeague\Uri\pairs_to_paramsLeague\Uri\QueryBuilderLeague\Uri\QueryParserLeague\Uri\Components\ComponentInterfaceLeague\Uri\Components\HierarchicalPath::createFromSegmentsLeague\Uri\Components\HierarchicalPath::getSegmentsLeague\Uri\Components\HierarchicalPath::getSegmentLeague\Uri\Components\HierarchicalPath::IS_ABSOLUTELeague\Uri\Components\HierarchicalPath::IS_RELATIVE- The following methods are transferred to the new
League\Uri\Components\Domainclass League\Uri\Components\Host::isAbsoluteLeague\Uri\Components\Host::getLabelsLeague\Uri\Components\Host::getLabelLeague\Uri\Components\Host::keysLeague\Uri\Components\Host::countLeague\Uri\Components\Host::getIteratorLeague\Uri\Components\Host::appendLeague\Uri\Components\Host::prependLeague\Uri\Components\Host::replaceLabelLeague\Uri\Components\Host::withoutLabelsLeague\Uri\Components\Host::withRootLabelLeague\Uri\Components\Host::withoutRootLabelLeague\Uri\Components\Query::ksortLeague\Uri\Components\Query::getParamsLeague\Uri\Components\Query::getParamLeague\Uri\Components\Query::getPairsLeague\Uri\Components\Query::getPairLeague\Uri\Components\Query::hasPair
- None
- None
- None
- None
- Issue #21 namespace collision
with exception usage in
Uri\QueryParserand QUri\QueryBuilder
- None
- None
- IPvFuture support
- Using PHPStan
- Using the new scrutinizr engine for PHP
- Bug fix Port class to conform to RFC3986 now allow any port number greater or equals to
0. - Improve Host parsing
- None
mbstringextension requirement
- None
- The
Hostresolver and its usage is lazyloaded so thatHostonly requires and used them if needed - Bug fix issue with:
Host::withPublicSuffixHost::withRegistrableDomainHost::withSubDomainmethods that were leaving the currentHostobject corrupted in some cases.
- None
- None
- Adding the possibility to use your own domain resolver object.
Host::__constructcan take an optionalRulesobject as the domain resolverHost::createFromIpcan take an optionalRulesobject as the domain resolverHost::createFromLabelscan take an optionalRulesobject as the domain resolverHost::withDomainResolverto enable switching to current domain resolver object
-
The domain resolver as a Rules object is now injecting into the Host domain so that its data can be cached independently of the filecache. If not domain resolver is provided the Host will fallback to using the filecache with the data being kept for 7 days in a
vendorsubdirectory. -
Decoupled the
QueryBuilderand theQueryParserfromComponentTrait
- None
- None
Host::withPublicSuffixto complete registered name manipulation methods
- registered name infos loading
- None
- None
Uri\QueryParserclass to parse any string into key/pair value or extract PHP valuesUri\QueryBuilderclass to build a valid query string from a collection of Key/pair valuesUri\pairs_to_paramsalias forQueryParser::convert
- URI Host parsing to respect RFC3986
- improve internal code
Query::parsereplaced byQueryParser::parseQuery::extractreplaced byQueryParser::extractQuery::buildreplaced byQueryBuilder::buildHost::getRegisterableDomainreplaced byHost::getRegistrableDomainHost::withRegisterableDomainreplaced byHost::withRegistrableDomain
- internal traits
QueryParserTrait,HostInfoTrait
- None
- URI Hostname parser local cache update
- None
- None
- Dependencies to League URI Hostname parser
- Issue #109 Dependencie on a unstable package
- None
- Dependencies to PHP Domaine parser
Query::getSeparator,Query::withSeparatorto allow modifying query string separator.Query::__constructtakes a second argument, the query separator which default to&.Query::__debugInfonows adds query separator informations.Query::withoutParamsto complementQuery::withoutPairsmethod.Query::createFromParamsto complementQuery::createFromPairsnamed constructor.Query::withoutNumericIndicesto normalized the query string by removing extra numeric indices added by the use ofhttp_build_query.Query::withoutEmptyPairsto normalized the query string #7 and #8
Query::mergeandQuery::appendnormalized the query string to remove empty pairs see #7 and #8Query::buildandUri\buildnow accept any iterable structure.
- None
- None
League\Uri\build_queryas an alias ofQuery::build
- function docblocks
- None
- None
League\Uri\parse_queryas an alias ofQuery::parseLeague\Uri\extract_queryas an alias ofQuery::extract
League\Uri\parse_queryreturned value was the wrong one
- None
- None
League\Uri\parse_queryas an alias ofQuery::extract
- Internal call in PHP7.2 with incompatible definitions
- update PHP Domain Parser to be compatible with PHP7.2 deprecation notice
- remove restriction to constructor characters for
Path,QueryandUserInfo.
- None
- None
- None
- Bug fix label conversion depending on locale issue #102
- None
- None
- None
- Bug fix negative offset issue #5
- None
- None
- None
- Improve registered name validation issue #5
- None
- None
- None
- Update idn to ascii algorithm from INTL_IDNA_VARIANT_2003 to INTL_IDNA_VARIANT_UTS46
- None
- None
- None
- Improve validation check for
Query::build - Remove `func_* function usage
- Improve
HierarchicalPath::createFromSegments - Internal code simplification
- None
- None
ComponentInterfaceEncodingInterfaceHierarchicalPath::withDirnameHierarchicalPath::withBasenameHierarchicalPath::withoutSegmentsHierarchicalPath::replaceSegmentHost::withRegisterableDomainHost::withSubdomainHost::withRootLabelHost::withoutRootLabelHost::withoutLabelsHost::replaceLabelQuery::getParamsQuery::getParamQuery::appendQuery::hasPairQuery::withoutPairs
- ComponentInterface::getContent supports RFC1738
- The methods that accept integer offset supports negative offset
HierarchicalPath::getSegmentHierarchicalPath::replaceSegmentHierarchicalPath::withoutSegmentsHost::getLabelHost::replaceLabelHost::withoutLabels
Query::mergeonly accepts string
- None
- PHP5 support
- Implementing
League\Uri\Interfaces\Component Query::hasKeyQuery::withoutQuery::filterHost::hasKeyHost::withoutHost::filterHost::replaceHierarchicalPath::hasKeyHierarchicalPath::withoutHierarchicalPath::filterHierarchicalPath::replaceLeague\Uri\Components\PathInterface
- None
-
Remove
League\Uri\Interfaces\CollectionComponentinterface dependencies from:League\Uri\Components\HostLeague\Uri\Components\HierarchicalPath
-
Bug fix
League\Uri\Components\Query::build -
Update dependencies on
League\Uri\Interfaces
- None
- None
- None
League\Uri\Components\Host::getContentnow support correctly RFC3987League\Uri\Components\Host::__toStringonly returns RFC3986 representationLeague\Uri\Components\UserInfo::getUserto use the$enc_typeparameterLeague\Uri\Components\UserInfo::getPassto use the$enc_typeparameter
- None
League\Uri\Components\Host::isIdnLeague\Uri\Components\Port::getDecodedLeague\Uri\Components\Scheme::getDecoded
League\Uri\Components\Exceptionas the base exception for the libraryLeague\Uri\Components\DataPath::getDecodedreturns the non-encoded pathLeague\Uri\Components\HierarchicalPath::getDecodedreturns the non-encoded pathLeague\Uri\Components\Path::getDecodedreturns the non-encoded pathLeague\Uri\Components\Fragment::getDecodedreturns the non-encoded fragmentLeague\Uri\Components\Port::getDecodedreturns the non-encoded portLeague\Uri\Components\Scheme::getDecodedreturns the non-encoded schemeLeague\Uri\Components\Query::extractpublic static method returns a hash similar toparse_strwithout the mangling from the query string
getContentis updated to support RFC3987
- None
Query::parseduseQuery::extractinsteadQuery::parsedValueuseQuery::extractinstead
- None
- issue #84. Query string is not well encoded.
- None
- None
Query::parsedreturns an array similar toparse_strresult with a second options with unmangled key.Query::getParsedValuereturns single value from the parse and unmangled PHP variables.Host::createFromIpa name constructor to create a host from a IPHost::getIpreturns the IP part from the host if present otherwise returnsnull
Host::__constructno longers takes a IPv6 without delimiter as a valid argument.
- None
- None
- improve dependencies - broken
- None
League\Uri\QueryParseris now a traitLeague\Uri\Components\Traits\QueryParserused byLeague\Uri\Components\QueryLeague\Uri\Components\UserInfonow only accepts string and null as constructor parameters.
- None
League\Uri\Components\UserLeague\Uri\Components\PassLeague\Uri\QueryParser