WordPress.org

Make WordPress Core

Changeset 48788


Ignore:
Timestamp:
08/12/2020 03:03:50 PM (14 months ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Remove final keyword from private methods.

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.

Props jrf.
Fixes #50897.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-session-tokens.php

    r47122 r48788  
    6767     * @return string A hash of the session token (a verifier).
    6868     */
    69     final private function hash_token( $token ) {
     69    private function hash_token( $token ) {
    7070        // If ext/hash is not present, use sha1() instead.
    7171        if ( function_exists( 'hash' ) ) {
  • trunk/tests/phpunit/tests/user/capabilities.php

    r47280 r48788  
    7474    }
    7575
    76     final private function _getSingleSitePrimitiveCaps() {
     76    private function _getSingleSitePrimitiveCaps() {
    7777        return array(
    7878
     
    156156    }
    157157
    158     final private function _getMultiSitePrimitiveCaps() {
     158    private function _getMultiSitePrimitiveCaps() {
    159159        return array(
    160160
     
    239239    }
    240240
    241     final private function _getSingleSiteMetaCaps() {
     241    private function _getSingleSiteMetaCaps() {
    242242        return array(
    243243            'create_sites'                => array(),
     
    277277    }
    278278
    279     final private function _getMultiSiteMetaCaps() {
     279    private function _getMultiSiteMetaCaps() {
    280280        return array(
    281281            'create_sites'                => array(),
Note: See TracChangeset for help on using the changeset viewer.