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 7fb2b8b commit 92f0cca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Ignition.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,14 @@ public function reset(): self
return $this;
}

public function register(): self
public function register(?int $errorLevels = null): self
{
error_reporting(-1);
error_reporting($errorLevels ?? -1);

/** @phpstan-ignore-next-line */
set_error_handler([$this, 'renderError']);
$errorLevels

Check failure on line 246 in src/Ignition.php

View workflow job for this annotation

GitHub Actions / phpstan

No error to ignore is reported on line 246.

Check failure on line 246 in src/Ignition.php

View workflow job for this annotation

GitHub Actions / phpstan

No error to ignore is reported on line 246.
? set_error_handler([$this, 'renderError'], $errorLevels)

Check failure on line 247 in src/Ignition.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter #1 $callback of function set_error_handler expects (callable(int, string, string, int): bool)|null, array{$this(Spatie\Ignition\Ignition), 'renderError'} given.

Check failure on line 247 in src/Ignition.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter #1 $callback of function set_error_handler expects (callable(int, string, string, int): bool)|null, array{$this(Spatie\Ignition\Ignition), 'renderError'} given.
: set_error_handler([$this, 'renderError']);

Check failure on line 248 in src/Ignition.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter #1 $callback of function set_error_handler expects (callable(int, string, string, int): bool)|null, array{$this(Spatie\Ignition\Ignition), 'renderError'} given.

Check failure on line 248 in src/Ignition.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter #1 $callback of function set_error_handler expects (callable(int, string, string, int): bool)|null, array{$this(Spatie\Ignition\Ignition), 'renderError'} given.

/** @phpstan-ignore-next-line */
set_exception_handler([$this, 'handleException']);
Expand Down

0 comments on commit 92f0cca

Please sign in to comment.