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

WordPress Trac noreply at wordpress.org
Sat Jan 3 21:41:50 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:
--------------------------+------------------
Changes (by nacin):

 * milestone:  Awaiting Review => 4.2


Comment:

 I 100% agree with this and it's been on my mind to do this for a while. I
 didn't bother to follow up and do it when it landed, because I knew we
 could adjust it later. But yes, sooner than later is better.

 These should only work for a whitelisted set of properties, and it should
 throw an incorrect usage notice (`_doing_it_wrong()`) when a property is
 accessed, set, or unset.

 We should be able to come up with some basic code to do this. One more
 method and one more property for each class. This would work best in a
 trait but we can't use those yet.

 This will be pretty tedious — patches welcome if someone wants to take a
 crack at it. :-)

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


More information about the wp-trac mailing list