diff --git a/app/Constants/ErrorCode.php b/app/Constants/ErrorCode.php index 76b59c8..c6c391c 100644 --- a/app/Constants/ErrorCode.php +++ b/app/Constants/ErrorCode.php @@ -25,7 +25,7 @@ enum ErrorCode: int implements ErrorCodeInterface */ case SERVER_ERROR = 500; - public function getMessage(array $translate = null): string + public function getMessage(?array $translate = null): string { $arguments = []; if ($translate) { diff --git a/app/Constants/ErrorCodeInterface.php b/app/Constants/ErrorCodeInterface.php index 4551c71..e6d296f 100644 --- a/app/Constants/ErrorCodeInterface.php +++ b/app/Constants/ErrorCodeInterface.php @@ -16,5 +16,5 @@ interface ErrorCodeInterface extends BackedEnum { - public function getMessage(array $translate = null): string; + public function getMessage(?array $translate = null): string; } diff --git a/app/Exception/BusinessException.php b/app/Exception/BusinessException.php index 3606225..f76c2ff 100644 --- a/app/Exception/BusinessException.php +++ b/app/Exception/BusinessException.php @@ -18,7 +18,7 @@ class BusinessException extends ServerException { - public function __construct(ErrorCodeInterface $code, string $message = null, Throwable $previous = null) + public function __construct(ErrorCodeInterface $code, ?string $message = null, ?Throwable $previous = null) { if (is_null($message)) { $message = $code->getMessage(); diff --git a/app/Kernel/Functions.php b/app/Kernel/Functions.php index aa005f5..11d3206 100644 --- a/app/Kernel/Functions.php +++ b/app/Kernel/Functions.php @@ -13,11 +13,12 @@ use Hyperf\AsyncQueue\JobInterface; use Hyperf\Context\ApplicationContext; use Hyperf\ExceptionHandler\Formatter\FormatterInterface; +use Psr\Container\ContainerInterface; if (! function_exists('di')) { /** * Finds an entry of the container by its identifier and returns it. - * @return mixed|\Psr\Container\ContainerInterface + * @return ContainerInterface|mixed */ function di(?string $id = null) {