[wp-trac] [WordPress Trac] #56876: Refactor magic methods in WP_List_Table, WP_User_Query, WP_Text_Diff_Renderer_Table and WP_Admin_Bar classes
WordPress Trac
noreply at wordpress.org
Tue Feb 21 02:28:14 UTC 2023
#56876: Refactor magic methods in WP_List_Table, WP_User_Query,
WP_Text_Diff_Renderer_Table and WP_Admin_Bar classes
--------------------------------------------+---------------------
Reporter: antonvlasenko | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.2
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests php82 | Focuses:
--------------------------------------------+---------------------
Old description:
> Developers should get a notice when trying to get or set a dynamic
> property on `WP_List_Table`.
> The current implementation of the class correctly handles some dynamic
> properties.
> But, in addition to the allowed dynamic properties, it enables the use of
> arbitrary properties.
> This behavior is incompatible with PHP 8.2 and should be fixed.
>
> Props to @jrf for identifying the issue 👏.
New description:
`WP_List_Table`, `WP_User_Query`, and `WP_Text_Diff_Renderer_Table`
classes implement some magic methods.
But these magic methods need to be refactored to ensure that these classes
are compatible with PHP 8.2 (the magic methods in these classes are only
partially implemented, the missing/incomplete magic methods should be
added/refactored).
Also, developers should get a warning when they try to set (get) dynamic
properties on objects of these classes.
As for the `WP_Admin_Bar` class: an investigation is needed to decide
whether `WP_Admin_Bar::__get()` can be removed.
Props to @jrf for identifying the issue 👏.
--
Comment (by ironprogrammer):
Updated description per comment:20.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56876#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list