Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR solves a deprecation warning reported when using this library in PHP 8.4
The reason for this warning is a protected method from the
Factory
class which has two arguments implicitly marked as nullable by having anull
default value.ip-lib/src/Factory.php
Line 225 in 125ab84
That is deprecated in PHP 8.4, and will error in PHP 9.0 and above.
One possible approach to solve that is explicitly marking the arguments as nullable (eg.
?AddressInterface $from = null
instead ofAddressInterface $from = null
), but that requires PHP 7.1, and this library supports older versions.Since the method where this error is reported was
protected
and being called only from one place, I moved the logic there instead, removing the method entirely.This can be a breaking change though, if anyone was extending from
Factory
and invoking this method from their own class, so perhaps this requires a major version bump.Additionally, this PR also adds PHP 8.3 and 8.4 to the tests workflow matrix.