Attachments (12)
Change History (34)
#1
@
15 years ago
- Keywords dev-feedback added
@todo WP_User tries to return a non-object. Throw an exception?
#2
@
15 years ago
- Summary Class Constructors Review for 3.2 → PHP5-port - Class Constructors Review for 3.2
#3
@
15 years ago
Related: #16782 - contains constructor changes for WP_Error, interesting case for having the constructor "returning" something (e.g. empty string) which is not possible and can be seen in other constructors inside wordpress as well.
#9
@
15 years ago
widgets.16768.diff moves widget classes to __construct().
The PHP4 constructor in WP_Widget can't be removed because it's likely used by plugins.
Patch also fixes the way WP_Widget::WP_Widget() calls __construct(), avoiding an endless loop.
#12
@
15 years ago
- Keywords dev-feedback removed
- Resolution fixed
- Status closed → reopened
16768.alot.patch: Some more. Needs a second review, I couldn't find any problems with that.
#14
@
15 years ago
- Resolution fixed
- Status closed → reopened
text_diff.16768.2.patch: Found a few more in Text Diff classes
#15
@
15 years ago
- Resolution → fixed
- Status reopened → closed
Thanks for your patch, but I asked ryan yesterday and he tolds me, to leave third party classes as it is.
#17
@
15 years ago
- Resolution fixed
- Status closed → reopened
Sorry, one more thing. Does this count?
text_diff.16768.3.patch
Fix the call to the parent's constructor in WP_Text_Diff_Renderer_Table
I am getting error's with a subclass WP_Text_Diff_Renderer_Table.
#18
@
15 years ago
Interesting, yes that works. I leave that, because I thought, that it won't work because of the missing __construct() in the parent class.
No errors before and after your patch. Which errors do you mean?
#19
@
15 years ago
The errors (before the patch) are from a plugin which uses a subclass of WP_Text_Diff_Renderer so its not a part of core, but this affects anyone wanting to subclass WP_Text_Diff_Renderer.
As far as PHP5 is concerned a constructor is a constructor, it doesn't seem to matter if the constructor is defined as the class name or defined as __construct.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
originating by hakre @ #10861