#16768 closed enhancement (fixed)
PHP5-port - Class Constructors Review for 3.2
Reported by: | hakre | Owned by: | |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Attachments (12)
Change History (34)
#1
@
14 years ago
- Keywords dev-feedback added
@todo WP_User tries to return a non-object. Throw an exception?
#2
@
14 years ago
- Summary changed from Class Constructors Review for 3.2 to PHP5-port - Class Constructors Review for 3.2
#3
@
14 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
@
14 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
@
14 years ago
- Keywords dev-feedback removed
- Resolution fixed deleted
- Status changed from closed to reopened
16768.alot.patch: Some more. Needs a second review, I couldn't find any problems with that.
#14
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
text_diff.16768.2.patch: Found a few more in Text Diff classes
#15
@
14 years ago
- Resolution set to fixed
- Status changed from reopened to closed
Thanks for your patch, but I asked ryan yesterday and he tolds me, to leave third party classes as it is.
#17
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to 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
@
14 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
@
14 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
.
originating by hakre @ #10861