- File URL reparse bug with percent encoded windows drive letter whatwg/url#589
- Switched to GitHub Actions for CI
- Minimum PHPUnit version is now 7.5
- Performance improvements
- Test on PHP 8 release in CI
- Support for
brick/math^0.9
- Serializing non-special URLs is now idempotent per whatwg/url#505
- Changes to file URL path normalization per whatwg/url#544.
- Added test coverage on Windows 32-bit.
- Dependency on
rowbot/idnato support international domain names withoutext-intl.
URLSearchParams::sort()now correctly sorts by code units instead of trying to fake it using code points.- Null bytes are now percent encoded in fragments instead of being ignored per whatwg/url#440.
- Domain names of URLs with special schemes can no longer be an empty string per whatwg/url#492 and whatwg/url#497.
- Host names now also forbid the use of the
<,>, and^code points per whatwg/url#458.
- Incorrect output encoding used when encoding was overriden to be "replacement", "utf-16", "utf-16le", or "utf-16be".
ext-jsonis now correctly listed as a dependency.
- Dependency on
ext-intlandlib-ICU.
- Improved portability and 32-bit PHP support.
- Dependency on
brick/mathto support 32-bit versions of PHP.
- Removed
ext-gmpas a dependency.
The majority of this library was rewritten in this update, but the public API has remain unchanged. This should make for a relatively painless upgrade.
- Installation requirement of ICU >= 4.6 to assist with #6
- Support for PHPUnit ^8.0 and ^9.0.
- More test coverage.
- Support for symfony/cache ^5.0.
- "gopher" was removed from the list of special schemes per whatwg/url#453 and whatwg/url#454.
- Coding style has been updated for PSR-12.
- Non-iterable objects passed to the
URLSearchParamsconstructor now have their properties iterated over using\ReflectionObject::getProperties()rather than directly. There should not be any change in behavior. - Removed artificial limitation when passing a sequence of sequences to the
URLSearchParamsconstructor that required the non-array sub-sequences to implement the\ArrayAccessinterface.- Note that sub-sequences must still be countable and only contain exactly 2 items.
- This broadens the type of sequences that can be supplied from
iterable<mixed, array{0: string, 1: string}>toiterable<mixed, iterable<mixed, stringable>>, wherestringableis a scalar value or an object with the__toString()method.
URLSearchParamsnow throws a\Rowbot\URL\Exception\TypeErrorinstead of a\InvalidArgumentexception to match browsers when passed an iterable that does not solely contain other iterables that are countable.- JSON encoding the
URLobject will now throw a\Rowbot\URL\Exception\JsonExceptionwhen JSON encoding fails.
- Documentaion errors.
- Restores expected string conversion behavior on systems using an ICU version >= 60.1 (#7).
Origin::getEffectiveDomain()was incorrectly returning the string"null"instead of the actual valuenullwhen the origin was an opaque origin.
phpstan/phpstanand associated packages are no longer a dev dependency and is now only run in CI.- No longer depends on
ext-ctype, which was an unlisted dependency. php-coveralls/php-coverallsis no longer a dev dependency. The project has moved to Codecov instead.squizlabs/php_codesnifferis no longer a dev dependency and is only run in CI now.
- "%2e%2E" and "%2E%2e" were not properly detected as percent encoded double dot path segments.
- PHP 7.4 compatibility
- Sped up IPv6 address serialization by removing some unncessary type casting.
- Loading cached test data failed when using newer versions of the symfony/cache component.
- Tests now automatically pull the latest data directly from the Web Platform Tests repository - thanks @nyamsprod
- The minimum required PHP version is now 7.1.
- Testing environment updated for PHP 7.1 - thanks @nyamsprod
- Native typehints are now used. This which means that an
\TypeErroris now thrown instead of an\InvalidArgumentExceptionwhen a value with an incorrect type is passed. \Rowbot\URL\Exception\TypeErrorand\Rowbot\URL\Exception\InvalidParserStatenow inherit from\Rowbot\URL\Exception\URLException
- Sped up
URLSearchParams::has()when the string does not exist in the list. - TravisCI automation for tests and code coverage.
- The query string sorting algorithm now correctly sorts by code units instead of code points.
- Updated documentation
- Updated tests
- Only scalar values (bool, float, int, string) and objects with a
__toString()method are considered as valid input now for methods and properties that only accept strings. This matches what PHP's string type hint would allow, allowing for an easier upgrade path when adding native type hints in the future.- A
nullvalue is no longer considered valid input and will cause an\InvalidArgumentExceptionto be thrown. Previously, this was converted to the string"null". - A
resourcevalue such as that returned by a call tofopen()is no longer considered valid input and will cause an\InvalidArgumentExceptionto be thrown. This was previously casted to a string resulting in something like"Resource id #1". - Previously, the values
trueandfalsewere converted to the strings"true"and"false". This is no longer the case. They now are now simply cast to a string resulting in the values"1"and""respectively.
- A
- Passing an
iterablethat does not solely contain otheriterablesto theURLSearchParamsconstructor now causes it to throw an\InvalidArgumentException. - Trying to access an invalid property on the
URLobject will now throw an\InvalidArgumentExceptionto help catch typos.
- Sped up serialization of IPv6 addresses
- Slightly better handling of non-UTF-8 encoded text when parsing query strings.
- A bunch of missing
useimport statements - Updated tests and test data.
- URLs with special schemes now percent encode
'characters in the query string. - The application/x-www-form-urlencoded parser now only handles UTF-8 encoded text.
- Trying to set
URL::searchParamsdirectly will now throw a\Rowbot\URL\Exception\TypeError - Passing invalid input will throw an
\InvalidArgumentException - Malformed byte sequences will now get fixed up with
\u{FFFD}replacement characters. URLSearchParamsnow implements\Iteratorinstead of\IteratorAggregateto match test expectations.
- The last few failing tests are now passing with the exception of 3 errors as a result of PHP bug 72506
- MIT License
- Initial Release!