#16768 closed enhancement (fixed)
PHP5-port - Class Constructors Review for 3.2
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.2 |
| Component: | General | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Attachments (12)
Change History (34)
comment:1
hakre
— 2 years ago
- Keywords dev-feedback added
@todo WP_User tries to return a non-object. Throw an exception?
comment:2
hakre
— 2 years ago
- Summary changed from Class Constructors Review for 3.2 to PHP5-port - Class Constructors Review for 3.2
comment:3
hakre
— 2 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.
comment:9
scribu
— 2 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.
comment:10
ryan
— 2 years ago
comment:11
ryan
— 2 years ago
- Resolution set to fixed
- Status changed from new to closed
comment:12
ocean90
— 2 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.
comment:13
ryan
— 2 years ago
- Resolution set to fixed
- Status changed from reopened to closed
comment:14
ampt
— 2 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
text_diff.16768.2.patch: Found a few more in Text Diff classes
comment:15
ocean90
— 2 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.
comment:16
ampt
— 2 years ago
Ok no problem, thanks.
comment:17
ampt
— 2 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.
comment:18
ocean90
— 2 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?
comment:19
ampt
— 2 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.
comment:20
markjaquith
— 2 years ago
In [17781]:
comment:21
jane
— 2 years ago
- Resolution set to fixed
- Status changed from reopened to closed
Freeze!
originating by hakre @ #10861