From 56b7a16980512703a7d99232717c8fe603e48d6c Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Tue, 10 Sep 2024 16:55:45 +0200 Subject: [PATCH] refactor(LoadSandbox) terser code --- src/WordPress/LoadSandbox.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/WordPress/LoadSandbox.php b/src/WordPress/LoadSandbox.php index a8dad5794..ffa55dce7 100644 --- a/src/WordPress/LoadSandbox.php +++ b/src/WordPress/LoadSandbox.php @@ -41,11 +41,8 @@ public function load(?DatabaseInterface $db = null): void // Silence errors about the redeclaration of the above `DB_` constants. $previousErrorHandler = set_error_handler(callback: static function ($errno, $errstr) { - if ($errno === E_WARNING && preg_match('/^Constant DB_(NAME|USER|PASSWORD|HOST) already defined/i', $errstr)) { - return true; - } - - return false; + return $errno === E_WARNING + && preg_match('/^Constant DB_(NAME|USER|PASSWORD|HOST) already defined/i', $errstr); }); }