1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Apply fixes from StyleCI

This commit is contained in:
Dan Brown
2021-06-26 15:23:15 +00:00
committed by StyleCI Bot
parent 3a402f6adc
commit 934a833818
349 changed files with 3655 additions and 2625 deletions

View File

@ -35,9 +35,10 @@ class Handler extends ExceptionHandler
* Report or log an exception.
*
* @param Exception $exception
* @return void
*
* @throws Exception
*
* @return void
*/
public function report(Exception $exception)
{
@ -47,8 +48,9 @@ class Handler extends ExceptionHandler
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param Exception $e
* @param \Illuminate\Http\Request $request
* @param Exception $e
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
@ -83,7 +85,7 @@ class Handler extends ExceptionHandler
$responseData = [
'error' => [
'message' => $e->getMessage(),
]
],
];
if ($e instanceof ValidationException) {
@ -92,14 +94,16 @@ class Handler extends ExceptionHandler
}
$responseData['error']['code'] = $code;
return new JsonResponse($responseData, $code, $headers);
}
/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
*
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
@ -114,8 +118,9 @@ class Handler extends ExceptionHandler
/**
* Convert a validation exception into a JSON response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Validation\ValidationException $exception
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Validation\ValidationException $exception
*
* @return \Illuminate\Http\JsonResponse
*/
protected function invalidJson($request, ValidationException $exception)