Register the error handler.
integer $level The level at which the conversion to Exception is done (null to use the error_reporting() value and 0 to disable):
The registered error handler
public static function register($level = null) {
$handler = new static();
$handler
->setLevel($level);
set_error_handler(array(
$handler,
'handle',
));
return $handler;
}