Skip to content

Support PHP 8.5#184

Open
Jan-Schuppik wants to merge 6 commits intomainfrom
support-php-85
Open

Support PHP 8.5#184
Jan-Schuppik wants to merge 6 commits intomainfrom
support-php-85

Conversation

@Jan-Schuppik
Copy link

@Jan-Schuppik Jan-Schuppik commented Dec 3, 2025

Changes made:

PHP 8.4:

PHP 8.5:

Other changes:

  • Update composer package guzzlehttp/psr7

resolves #181

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.

Looks good

@Jan-Schuppik Jan-Schuppik changed the title Support php 85 Support php 8.4/8.5 Dec 5, 2025
sukhwinder33445
sukhwinder33445 previously approved these changes Dec 5, 2025
@lippserd lippserd changed the title Support php 8.4/8.5 Support PHP 8.5 Jan 8, 2026
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, I have a few comments on the commit messages and descriptions:

For 982ef28, please use something like the following, as suggested in Icinga/ipl-stdlib#61 (review):

PHP 8.4: Change implicit nullable type declaration to explicit

Since PHP 8.4 implicitly nullable parameter types are deprecated.

The reason for upgrading guzzlehttp/psr7 in d5b0989 is misleading, as version 2.8.0 introduces PHP 8.5 support and is a dependency for this library. In general, our ipl-* repositories build our Icinga PHP library, not the other way around. Therefore, we should never have such "streamline" commits. Something similar was also discussed/addressed in Icinga/ipl-validator#38.

For 41413f0, the commit message could be worded more precisely, and a description justifying the removal should be added, e.g.:

PHP 8.5: Remove deprecated method `ReflectionProperty::setAccessible()`

Since we require PHP >= 8.2 and since calling this method has no effect as of
PHP 8.1.0, as all properties are accessible by default, it is safe to simply
remove this method call.

Finally, 3ef2e00 could be rephrased to PHP 8.5: Replace usage of `null` as array offset. A description that only contains a reference to the PHP documentation is not necessary, but something like the following:

Since PHP 8.5 using `null` as an array offset is deprecated. Code relying on 
`null` being silently converted to an empty string must be replaced and
discouraged in PHPDocs.

@lippserd
Copy link
Member

lippserd commented Jan 9, 2026

And please also add a PR description.

Al2Klimov added a commit to Icinga/icinga-php-library that referenced this pull request Jan 15, 2026
@sukhwinder33445 sukhwinder33445 force-pushed the support-php-85 branch 3 times, most recently from 217ad5b to 83c1631 Compare January 16, 2026 09:48
@sukhwinder33445 sukhwinder33445 force-pushed the support-php-85 branch 4 times, most recently from 14e80c6 to 5b99c1c Compare January 16, 2026 12:18
@sukhwinder33445
Copy link
Contributor

sukhwinder33445 commented Jan 16, 2026

I have adjusted the classes SelectElement, RadioElement and the tests. Please have a look @lippserd.

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.

Both concerns regarding the radio element also apply to the select element.

@sukhwinder33445 sukhwinder33445 force-pushed the support-php-85 branch 2 times, most recently from 8f31882 to a350cc5 Compare January 22, 2026 10:12
Al2Klimov added a commit to Icinga/icinga-php-library that referenced this pull request Jan 22, 2026
@sukhwinder33445 sukhwinder33445 force-pushed the support-php-85 branch 2 times, most recently from 491328a to c26ebdc Compare January 22, 2026 11:08
Al2Klimov added a commit to Icinga/icinga-php-library that referenced this pull request Jan 22, 2026
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.

Since explicit is better than implicit, I also suggest adding new assertNull() calls after the setValue() calls at the end of testNullAndTheEmptyStringValuesAreEquallyHandled() for both Radio and SelectElementTest. If I'm not mistaken, there is no check to validate if setValue(''|null) leads to getValue(): null.

sukhwinder33445 and others added 6 commits January 23, 2026 10:23
Since PHP 8.4 implicitly nullable parameter types are deprecated.
Since we require PHP >= 8.2 and since calling this method has no effect as of
PHP 8.1.0, as all properties are accessible by default, it is safe to simply
remove this method call.
Since PHP 8.5 using `null` as an array offset is deprecated. Code relying on
`null` being silently converted to an empty string must be replaced and
discouraged in PHPDocs.
- (Radio|Select)Option: Remove support for `null` value by defining the parameter types for the constructor
- Ensure empty-string `''` option cannot be `disabled|checked|selected` by falsy values except `null` and `''`
- Adjust tests accordingly and remove redundant tests
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.

Thanks 👍

Al2Klimov added a commit to Icinga/icinga-php-library that referenced this pull request Jan 23, 2026
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