Skip to content

Commit

Permalink
refactor(LoadSandbox) terser code
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Sep 10, 2024
1 parent aad84df commit 56b7a16
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/WordPress/LoadSandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down

0 comments on commit 56b7a16

Please sign in to comment.