-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the data dynamic property in WP_Term #4307
Fix the data dynamic property in WP_Term #4307
Conversation
24f1e96
to
993587a
Compare
tests/phpunit/tests/term.php
Outdated
* @coversNothing | ||
* | ||
* @param stdClass $actual An instance of stdClass containing the values to initialize the WP_Term object. | ||
* @param array $expected An array containing the expected values for the WP_Term object. | ||
* | ||
* @dataProvider data_get_raw_data_should_return_correct_values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @coversNothing | |
* | |
* @param stdClass $actual An instance of stdClass containing the values to initialize the WP_Term object. | |
* @param array $expected An array containing the expected values for the WP_Term object. | |
* | |
* @dataProvider data_get_raw_data_should_return_correct_values | |
* @dataProvider data_get_raw_data_should_return_correct_values | |
* | |
* @param stdClass $actual An instance of stdClass containing the values to initialize the WP_Term object. | |
* @param array $expected An array containing the expected values for the WP_Term object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review, @mukeshpanchal27.
I agree with the proposed changes; however, I don't think the @covers
tag should be removed.
Fixed in 0e8df1a
e6e9171
to
6ac4bff
Compare
Thank you for the code review, @mukeshpanchal27. |
The WP_Term class employs the __get magic method to compute the object data. However, since PHP 8.2 does not support dynamic properties, it is better to eliminate this approach.
Fix indentation. Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
caef2fc
to
4059886
Compare
I'm closing this PR as the solution needs more refinement. |
This PR aims to solve the issue with the
WP_Term::$data
dynamic property.The
WP_Term
class employs the__get
magic method to compute the object data.However, since PHP 8.2 does not support dynamic properties, it is better to eliminate this approach.
Trac ticket: https://core.trac.wordpress.org/ticket/58087
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.