- Improved portability and 32-bit PHP support.
- Dependency on
brick/math
to support 32-bit versions of PHP.
- Removed
ext-gmp
as 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
URLSearchParams
constructor 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
URLSearchParams
constructor that required the non-array sub-sequences to implement the\ArrayAccess
interface.- 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>>
, wherestringable
is a scalar value or an object with the__toString()
method.
URLSearchParams
now throws a\Rowbot\URL\Exception\TypeError
instead of a\InvalidArgument
exception to match browsers when passed an iterable that does not solely contain other iterables that are countable.- JSON encoding the
URL
object will now throw a\Rowbot\URL\Exception\JsonException
when 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 valuenull
when the origin was an opaque origin.
phpstan/phpstan
and 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-coveralls
is no longer a dev dependency. The project has moved to Codecov instead.squizlabs/php_codesniffer
is 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
\TypeError
is now thrown instead of an\InvalidArgumentException
when a value with an incorrect type is passed. \Rowbot\URL\Exception\TypeError
and\Rowbot\URL\Exception\InvalidParserState
now 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
null
value is no longer considered valid input and will cause an\InvalidArgumentException
to be thrown. Previously, this was converted to the string"null"
. - A
resource
value such as that returned by a call tofopen()
is no longer considered valid input and will cause an\InvalidArgumentException
to be thrown. This was previously casted to a string resulting in something like"Resource id #1"
. - Previously, the values
true
andfalse
were 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
iterable
that does not solely contain otheriterables
to theURLSearchParams
constructor now causes it to throw an\InvalidArgumentException
. - Trying to access an invalid property on the
URL
object will now throw an\InvalidArgumentException
to 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
use
import 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::searchParams
directly 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. URLSearchParams
now implements\Iterator
instead of\IteratorAggregate
to 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!