mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-23 22:42:38 +01:00
Use array_replace instead of manually looping through items
This commit is contained in:
parent
f72392d0e6
commit
b33357d16b
@ -81,12 +81,7 @@ class ErrorHandler
|
||||
public function registerErrorHandler(array $levelMap = array(), $callPrevious = true, $errorTypes = -1)
|
||||
{
|
||||
$prev = set_error_handler(array($this, 'handleError'), $errorTypes);
|
||||
$this->errorLevelMap = $this->defaultErrorLevelMap();
|
||||
// merging the map into the defaults by hand because array_merge
|
||||
// trips up on numeric keys
|
||||
foreach ($levelMap as $key => $val) {
|
||||
$this->errorLevelMap[$key] = $val;
|
||||
}
|
||||
$this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap);
|
||||
if ($callPrevious) {
|
||||
$this->previousErrorHandler = $prev ?: true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user