#51557 closed task (blessed) (fixed)
Modernize: use explicit visibility for property declarations
Reported by: | jrf | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.6 | Priority: | normal |
Severity: | minor | Version: | 5.6 |
Component: | General | Keywords: | has-patch commit |
Focuses: | coding-standards | Cc: |
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)
This ticket was mentioned in PR #614 on WordPress/wordpress-develop by jrfnl.
4 years ago
#1
- Keywords has-unit-tests added
#4
@
4 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 49184:
Note: See
TracTickets for help on using
tickets.
Using
var
or just and onlystatic
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.Trac ticket: https://core.trac.wordpress.org/ticket/51557