From 9440ec357003806da169c1fd3b5dbaae90f8f312 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 18 Sep 2020 07:55:26 +0000 Subject: [PATCH] Change __wakeup() to a public method to avoid PHP8 warning. --- includes/rest-api/Utilities/SingletonTrait.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/rest-api/Utilities/SingletonTrait.php b/includes/rest-api/Utilities/SingletonTrait.php index efeefe6e3d4..b713a6ccbd2 100644 --- a/includes/rest-api/Utilities/SingletonTrait.php +++ b/includes/rest-api/Utilities/SingletonTrait.php @@ -45,5 +45,8 @@ trait SingletonTrait { /** * Prevent unserializing. */ - private function __wakeup() {} + final public function __wakeup() { + wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'woocommerce' ), '4.6' ); + die(); + } }