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
This commit is contained in:
Sergey Biryukov 2020-08-12 15:03:50 +00:00
parent 56b096195a
commit 1bf0a780b3
2 changed files with 5 additions and 5 deletions

View File

@ -66,7 +66,7 @@ abstract class WP_Session_Tokens {
* @param string $token Session token to hash. * @param string $token Session token to hash.
* @return string A hash of the session token (a verifier). * @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 ext/hash is not present, use sha1() instead.
if ( function_exists( 'hash' ) ) { if ( function_exists( 'hash' ) ) {
return hash( 'sha256', $token ); return hash( 'sha256', $token );

View File

@ -73,7 +73,7 @@ class Tests_User_Capabilities extends WP_UnitTestCase {
return $meta_value; return $meta_value;
} }
final private function _getSingleSitePrimitiveCaps() { private function _getSingleSitePrimitiveCaps() {
return array( return array(
'unfiltered_html' => array( 'administrator', 'editor' ), '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( return array(
'unfiltered_html' => array(), 'unfiltered_html' => array(),
@ -238,7 +238,7 @@ class Tests_User_Capabilities extends WP_UnitTestCase {
} }
final private function _getSingleSiteMetaCaps() { private function _getSingleSiteMetaCaps() {
return array( return array(
'create_sites' => array(), 'create_sites' => array(),
'delete_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( return array(
'create_sites' => array(), 'create_sites' => array(),
'delete_sites' => array(), 'delete_sites' => array(),