#50897 closed defect (bug) (fixed)
PHP 8: fix final private methods
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.6 | Priority: | normal |
| Severity: | minor | Version: | |
| Component: | General | Keywords: | has-patch php8 has-unit-tests has-dev-note |
| Focuses: | coding-standards | Cc: |
Description
Declaring a private method as final is an oxymoron, as private methods cannot be overloaded anyway.
Using final private function... will generate a warning in PHP 8.
The attached patch fixes all known instances of this in WP Core at the time of writing.
Attachments (1)
Change History (8)
This ticket was mentioned in PR #467 on WordPress/wordpress-develop by jrfnl.
5 years ago
#2
- Keywords has-unit-tests added
#6
@
5 years ago
- Keywords needs-dev-note added
Adding needs-dev-note to include in the PHP 8 developer note.
#7
@
5 years ago
- Keywords has-dev-note added; needs-dev-note removed
Dev note published: https://make.wordpress.org/core/2020/11/23/wordpress-and-php-8-0/
Note: See
TracTickets for help on using
tickets.
Declaring a
privatemethod asfinalis an oxymoron, asprivatemethods cannot be overloaded anyway.This will generate a warning in PHP 8.
Trac ticket: https://core.trac.wordpress.org/ticket/50897