From a1ba777925d4846a406068b367bab207ab89b10f Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Tue, 11 Aug 2020 03:40:44 +0200
Subject: [PATCH] PHP 8.0: fix final private methods
Declaring a `private` method as `final` is an oxymoron, as `private` methods cannot be overloaded anyway.
This will generate a warning in PHP 8.
---
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
|
b
|
abstract class WP_Session_Tokens {
|
| 66 | 66 | * @param string $token Session token to hash. |
| 67 | 67 | * @return string A hash of the session token (a verifier). |
| 68 | 68 | */ |
| 69 | | final private function hash_token( $token ) { |
| | 69 | private function hash_token( $token ) { |
| 70 | 70 | // If ext/hash is not present, use sha1() instead. |
| 71 | 71 | if ( function_exists( 'hash' ) ) { |
| 72 | 72 | 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
|
b
|
class Tests_User_Capabilities extends WP_UnitTestCase {
|
| 73 | 73 | return $meta_value; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | | final private function _getSingleSitePrimitiveCaps() { |
| | 76 | private function _getSingleSitePrimitiveCaps() { |
| 77 | 77 | return array( |
| 78 | 78 | |
| 79 | 79 | 'unfiltered_html' => array( 'administrator', 'editor' ), |
| … |
… |
class Tests_User_Capabilities extends WP_UnitTestCase {
|
| 155 | 155 | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | | final private function _getMultiSitePrimitiveCaps() { |
| | 158 | private function _getMultiSitePrimitiveCaps() { |
| 159 | 159 | return array( |
| 160 | 160 | |
| 161 | 161 | 'unfiltered_html' => array(), |
| … |
… |
class Tests_User_Capabilities extends WP_UnitTestCase {
|
| 238 | 238 | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | | final private function _getSingleSiteMetaCaps() { |
| | 241 | private function _getSingleSiteMetaCaps() { |
| 242 | 242 | return array( |
| 243 | 243 | 'create_sites' => array(), |
| 244 | 244 | 'delete_sites' => array(), |
| … |
… |
class Tests_User_Capabilities extends WP_UnitTestCase {
|
| 276 | 276 | ); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | | final private function _getMultiSiteMetaCaps() { |
| | 279 | private function _getMultiSiteMetaCaps() { |
| 280 | 280 | return array( |
| 281 | 281 | 'create_sites' => array(), |
| 282 | 282 | 'delete_sites' => array(), |