From 0a3300e816f4a2da1d95e9cd6d04b9be0c7d5c89 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 17 Oct 2023 08:00:05 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Support/Traits/ExceptionTrait.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Support/Traits/ExceptionTrait.php b/src/Support/Traits/ExceptionTrait.php index 8cb90e5..15261da 100644 --- a/src/Support/Traits/ExceptionTrait.php +++ b/src/Support/Traits/ExceptionTrait.php @@ -36,7 +36,9 @@ protected function prepareJsonResponse($request, $e) // 或者是 ajax 请求,header 中包含 X-Requested-With:XMLHttpRequest; $exceptionConfig = Config::get('response.exception.'.get_class($e)); - if (!is_null($exceptionConfig)) return parent::prepareJsonResponse($request, $e); + if (! is_null($exceptionConfig)) { + return parent::prepareJsonResponse($request, $e); + } /** @var \Illuminate\Foundation\Exceptions\Handler $this */ $isHttpException = $this->isHttpException($e); @@ -83,7 +85,7 @@ protected function invalidJson($request, ValidationException $exception) { $exceptionConfig = Config::get('response.exception.'.ValidationException::class); - return !is_null($exceptionConfig) ? Response::fail( + return ! is_null($exceptionConfig) ? Response::fail( $exception->validator->errors()->first(), Arr::get($exceptionConfig, 'code', 422), $exception->errors()