modify plugin name

This commit is contained in:
2022-06-22 16:57:11 +08:00
parent f595f1146e
commit 8630d79519
2 changed files with 42 additions and 5 deletions
+25 -5
View File
@@ -49,15 +49,35 @@ class ErrorHandler extends Component implements ErrorInterface
/**
* 错误处理注册
* @param array|null $callback
* @return void
*/
public function register()
public function registerExceptionHandler(?array $callback): void
{
set_exception_handler([$this, 'exceptionHandler']);
set_error_handler([$this, 'errorHandler']);
register_shutdown_function([$this, 'shutdown']);
set_exception_handler($callback ?? [$this, 'exceptionHandler']);
}
/**
* @param array|null $callback
* @return void
*/
public function registerErrorHandler(?array $callback): void
{
set_error_handler($callback ?? [$this, 'errorHandler']);
}
/**
* @param array|null $callback
* @return void
*/
public function registerShutdownHandler(?array $callback): void
{
register_shutdown_function($callback ?? [$this, 'shutdown']);
}
/**
* @return void
* @throws ContainerExceptionInterface