function ErrorHandler::enable
File
-
vendor/
phpunit/ phpunit/ src/ Runner/ ErrorHandler.php, line 174
Class
- ErrorHandler
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\RunnerCode
public function enable() : void {
if ($this->enabled) {
return;
}
$oldErrorHandler = set_error_handler($this);
if ($oldErrorHandler !== null) {
restore_error_handler();
return;
}
$this->enabled = true;
$this->originalErrorReportingLevel = error_reporting();
error_reporting($this->originalErrorReportingLevel & self::UNHANDLEABLE_LEVELS);
}