Use PSR-12 code style

This commit is contained in:
James Cole
2022-10-30 14:24:10 +01:00
parent 1667b88dcd
commit 64ff5eed27
28 changed files with 96 additions and 129 deletions

View File

@@ -96,7 +96,7 @@ class Handler extends ExceptionHandler
// somehow Laravel handler does not catch this:
return response()->json(['message' => $e->getMessage(), 'exception' => 'OAuthServerException'], 401);
}
if($e instanceof BadRequestHttpException) {
if ($e instanceof BadRequestHttpException) {
return response()->json(['message' => $e->getMessage(), 'exception' => 'BadRequestHttpException'], 400);
}
@@ -107,7 +107,7 @@ class Handler extends ExceptionHandler
if ($request->expectsJson()) {
$errorCode = 500;
$errorCode = $e instanceof MethodNotAllowedHttpException ? 405: $errorCode;
$errorCode = $e instanceof MethodNotAllowedHttpException ? 405 : $errorCode;
$isDebug = config('app.debug', false);
if ($isDebug) {
@@ -140,7 +140,7 @@ class Handler extends ExceptionHandler
return response()->view('errors.FireflyException', ['exception' => $e, 'debug' => $isDebug], 500);
}
// special view for database errors with extra instructions
if($e instanceof QueryException) {
if ($e instanceof QueryException) {
$isDebug = config('app.debug');
return response()->view('errors.DatabaseException', ['exception' => $e, 'debug' => $isDebug], 500);
@@ -215,9 +215,10 @@ class Handler extends ExceptionHandler
{
return !is_null(
Arr::first(
$this->dontReport, function ($type) use ($e) {
return $e instanceof $type;
}
$this->dontReport,
function ($type) use ($e) {
return $e instanceof $type;
}
)
);
}