From 1bf0a780b3062e241fada5db99c425f54141dad0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 12 Aug 2020 15:03:50 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@48788 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-session-tokens.php | 2 +- tests/phpunit/tests/user/capabilities.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/class-wp-session-tokens.php b/src/wp-includes/class-wp-session-tokens.php index 033add33c4..a1a779b236 100644 --- a/src/wp-includes/class-wp-session-tokens.php +++ b/src/wp-includes/class-wp-session-tokens.php @@ -66,7 +66,7 @@ abstract class WP_Session_Tokens { * @param string $token Session token to hash. * @return string A hash of the session token (a verifier). */ - final private function hash_token( $token ) { + private function hash_token( $token ) { // If ext/hash is not present, use sha1() instead. if ( function_exists( 'hash' ) ) { return hash( 'sha256', $token ); diff --git a/tests/phpunit/tests/user/capabilities.php b/tests/phpunit/tests/user/capabilities.php index a5b7f3c55d..7a55db18d1 100644 --- a/tests/phpunit/tests/user/capabilities.php +++ b/tests/phpunit/tests/user/capabilities.php @@ -73,7 +73,7 @@ class Tests_User_Capabilities extends WP_UnitTestCase { return $meta_value; } - final private function _getSingleSitePrimitiveCaps() { + private function _getSingleSitePrimitiveCaps() { return array( 'unfiltered_html' => array( 'administrator', 'editor' ), @@ -155,7 +155,7 @@ class Tests_User_Capabilities extends WP_UnitTestCase { } - final private function _getMultiSitePrimitiveCaps() { + private function _getMultiSitePrimitiveCaps() { return array( 'unfiltered_html' => array(), @@ -238,7 +238,7 @@ class Tests_User_Capabilities extends WP_UnitTestCase { } - final private function _getSingleSiteMetaCaps() { + private function _getSingleSiteMetaCaps() { return array( 'create_sites' => array(), 'delete_sites' => array(), @@ -276,7 +276,7 @@ class Tests_User_Capabilities extends WP_UnitTestCase { ); } - final private function _getMultiSiteMetaCaps() { + private function _getMultiSiteMetaCaps() { return array( 'create_sites' => array(), 'delete_sites' => array(),