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); }); }