Skip to content

Commit

Permalink
Add support for configureable error levels
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed May 3, 2024
1 parent 4eb1487 commit e996f34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Flare.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,11 @@ public function registerExceptionHandler(): self
return $this;
}

public function registerErrorHandler(int $errorLevels = E_ALL | E_STRICT): self
public function registerErrorHandler(?int $errorLevels = null): self
{
$this->previousErrorHandler = set_error_handler([$this, 'handleError'], $errorLevels);
$this->previousErrorHandler = $errorLevels
? set_error_handler([$this, 'handleError'], $errorLevels)
: set_error_handler([$this, 'handleError']);

return $this;
}
Expand Down

0 comments on commit e996f34

Please sign in to comment.