[wp-trac] [WordPress Trac] #56876: Dynamic Properties: Fix 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
Thu May 25 14:54:21 UTC 2023


#56876: Dynamic Properties: Fix magic methods in WP_List_Table, WP_User_Query,
WP_Text_Diff_Renderer_Table and WP_Admin_Bar classes
-------------------------------------------------+-------------------------
 Reporter:  antonvlasenko                        |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  6.3
Component:  Administration                       |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests php82       |     Focuses:
  early commit reporter-feedback                 |
-------------------------------------------------+-------------------------
Changes (by costdev):

 * keywords:  has-patch has-unit-tests php82 early commit => has-patch has-
     unit-tests php82 early commit reporter-feedback


Old description:

> `WP_List_Table`, `WP_User_Query`, and `WP_Text_Diff_Renderer_Table`
> classes implement an incomplete set of 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 👏.
>
> References:
> * These changes were [https://www.youtube.com/watch?v=vDZWepDQQVE&t=9362s
> discussed and agreed to in a livestream] by @jrf @markjaquith and
> @hellofromTonya.
> * The changes are part of #56034, which is the larger Dynamic Properties
> proposal and initiative.

New description:

 `WP_List_Table`, `WP_User_Query`, and `WP_Text_Diff_Renderer_Table`
 classes implement an incomplete set of 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 .

 References:
 * These changes were [https://www.youtube.com/watch?v=vDZWepDQQVE&t=9362s
 discussed and agreed to in a livestream] by @jrf @markjaquith and
 @hellofromTonya.
 * The changes are part of #56034, which is the larger Dynamic Properties
 proposal and initiative.

--

Comment:

 This ticket was discussed in the recent bug scrub. It was felt that
 splitting this into separate tickets would help each move forward and for
 the respective ticket to be closed in the appropriate milestone (and
 possibly component).

 @antonvlasenko Are you happy to handle the creation of separate tickets?
 And is this one ready to rename and close for `WP_Admin_Bar`?

 Additional props: @audrasjb @SergeyBiryukov

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56876#comment:35>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list