Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

PHP 8.3 | ReportWidthTest: fix deprecation notices for ReflectionProperty::setValue()#5984

Merged
swissspidy merged 1 commit into
wp-cli:mainwp-cli/wp-cli:mainfrom
jrfnl:feature/php-8.3-fix-reflectionproperty-setvaluejrfnl/wp-cli:feature/php-8.3-fix-reflectionproperty-setvalueCopy head branch name to clipboard
Sep 17, 2024
Merged

PHP 8.3 | ReportWidthTest: fix deprecation notices for ReflectionProperty::setValue()#5984
swissspidy merged 1 commit into
wp-cli:mainwp-cli/wp-cli:mainfrom
jrfnl:feature/php-8.3-fix-reflectionproperty-setvaluejrfnl/wp-cli:feature/php-8.3-fix-reflectionproperty-setvalueCopy head branch name to clipboard

Conversation

@jrfnl

@jrfnl jrfnl commented Sep 16, 2024

Copy link
Copy Markdown
Contributor

The ReflectionProperty::setValue() method supports three method signatures, two of which are deprecated as of PHP 8.3.

This adjusts the call to ReflectionProperty::setValue() in various methods in the UtilsTest class to pass null as the "object" for setting the value of a static property to make the method calls cross-version compatible.

Note: these deprecations were visible in the test summary, but the tests - as they currently are - are not set up correctly to fail builds on deprecation notices, which is probably why this went unnoticed.

Ref: https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#reflectionpropertysetvalue

@jrfnl jrfnl requested a review from a team as a code owner September 16, 2024 22:11
…erty::setValue()

The `ReflectionProperty::setValue()` method supports three method signatures, two of which are deprecated as of PHP 8.3.

This adjusts the call to `ReflectionProperty::setValue()` in various methods in the `UtilsTest` class to pass `null` as the "object" for setting the value of a static property to make the method calls cross-version compatible.

Note: these deprecations were visible in the test summary, but the tests - as they currently are - are not set up correctly to fail builds on deprecation notices, which is probably why this went unnoticed.

Ref: https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#reflectionpropertysetvalue
@jrfnl jrfnl force-pushed the feature/php-8.3-fix-reflectionproperty-setvalue branch from 8217065 to 51fd5dc Compare September 17, 2024 15:56
@jrfnl

jrfnl commented Sep 17, 2024

Copy link
Copy Markdown
Contributor Author

Rebased without changes after the merge of #5982. This should allow to get a passing build.

@swissspidy swissspidy merged commit 35ee521 into wp-cli:main Sep 17, 2024
@swissspidy swissspidy added this to the 2.12.0 milestone Sep 17, 2024
@jrfnl jrfnl deleted the feature/php-8.3-fix-reflectionproperty-setvalue branch September 17, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.