Skip to content

Conversation

@BastianLedererIcinga
Copy link

@BastianLedererIcinga BastianLedererIcinga commented Dec 1, 2025

Changes that had to be addressed

PHP 8.3 -> PHP 8.4

Migration docs: https://www.php.net/manual/en/migration84

  • Function parameters that are null by default must be declared nullable.

PHP 8.4 -> PHP 8.5

Migration Docs: https://www.php.net/manual/en/migration85

  • Several aliases of SplObjectStorage methods are deprecated in 8.5.
  • Using null as array key is deprecated.

In addition the phpstan-baseline.neon has been updated, because some of it's errors were no longer reported.

resolves: #153

sukhwinder33445
sukhwinder33445 previously approved these changes Dec 4, 2025
Copy link
Contributor

@sukhwinder33445 sukhwinder33445 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BastianLedererIcinga BastianLedererIcinga force-pushed the 8.4/8.5-compatibility branch 2 times, most recently from e925968 to 40c7f0b Compare December 12, 2025 07:33
Copy link
Member

@lippserd lippserd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the requested changes, please note a recent PR comment on commit messages and descriptions, as there is room for improvement here.

Please also justify the adjustment to the PHPStan Baseline. Why is it necessary, what has been changed, and so on.

*/
$column = $condition->metaData()->get('columnName');
if (isset($this->properties[$column])) {
if (isset($column) && isset($this->properties[$column])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using isset() on a variable that just holds a function’s return value is not idiomatic. A strict comparison with null is clearer and more appropriate because it expresses that you only care about distinguishing null from any other value, not about existence vs. non‑existence.
Furthermore, this is also a change in behavior, as $array[null] is treated as $array[‘’] in previous versions. I have no objection to this change, but it should be justified in the commit description.

This change is also not yet included in the PR description.

@lippserd lippserd changed the title 8.4/8.5 compatibility Support PHP 8.5 Dec 18, 2025
Since PHP 8.4 implicitly nullable parameters are deprecated.
The methods `contains()`, `attach()` and `detach()`
of `SplObjectStorage` are deprecated since PHP 8.5
The functions `offsetExists()`, `offsetSet()` and `offsetUnset()`
must be used instead.
Errors that were no longer reported have been removed,
keeping them in the baseline could hide future errors.
Since PHP 8.5 using null as array key is deprecated.
If used as an array key is converted to an empty string,
which is most likely not a valid key in the properties array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.4/8.5 Support

4 participants