#51557 closed task (blessed) (fixed)
Modernize: use explicit visibility for property declarations
| Reported by: | jrf | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.6 |
| Component: | General | Version: | 5.6 |
| Severity: | minor | Keywords: | has-patch commit |
| Cc: | Focuses: | coding-standards |
Description
Using var or just and only static to declare a class property is PHP 4 code. PHP 5 introduced visibility modifiers.
This updates the code base to use explicit visibility modifier for properties.
No review has been done on what the visibility of the properties should be as a property without visibility defaults to public and changing that to a more closed visibility would be a BC-break.
Note: the same should be done for class methods at some point, but I wouldn't want the fixes for that to interfere with patches for ticket #51533, so I'm leaving that till later.
Related to #50767
Attachments (1)
Change History (7)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Using
varor just and onlystaticto declare a class property is PHP 4 code. PHP 5 introduced visibility modifiers.This updates the code base to use explicit visibility modifier for properties.
No review has been done on what the visibility of the properties _should_ be as a property without visibility defaults to
publicand changing that to a more closed visibility would be a BC-break.Trac ticket: https://core.trac.wordpress.org/ticket/51557