[wp-trac] [WordPress Trac] #30891: Unchecked property overloading is detrimental to OOP.

WordPress Trac noreply at wordpress.org
Sat Jan 10 22:10:03 UTC 2015


#30891: Unchecked property overloading is detrimental to OOP.
--------------------------+------------------
 Reporter:  aercolino     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.2
Component:  General       |     Version:  4.0
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------

Comment (by wonderboymusic):

 In [changeset:"31134"]:
 {{{
 #!CommitTicketReference repository="" revision="31134"
 In `Custom_Image_Header`:

 * In [28481], `$admin_header_callback` and `$admin_image_div_callback`
 were set to `private` based on their erroneous `@param` values
 * `$admin_header_callback` and `$admin_image_div_callback` are used as
 hook callbacks - as such, they must be `public`
 * In [28521] and [28524], magic methods were added for back-compat
 * Currently, there are 4 properties marked `private`: `$uploaded_headers`,
 `$default_headers`, `$page`, and `$updated` - `$page` and
 `$uploaded_headers` are never used and `$updated` was added by me in
 [30187] during 4.1. `$default_headers` does not necessarily need to be
 `private`

 Set `$admin_header_callback` and `$admin_image_div_callback` to `public`.
 Remove the `$page` property - it duplicated the `$page` local var and is
 referenced/used nowhere.
 Remove the `$uploaded_headers` property - it is used nowhere and is dead
 code.
 Set `$default_headers` to `public`.
 Remove the magic methods - they were beyond overkill and rendered moot by
 the above changes.

 See #30891.
 }}}

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


More information about the wp-trac mailing list