Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
martiendt authored and StyleCIBot committed Nov 4, 2017
1 parent 8155240 commit cad2311
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions app/Exceptions/ApiExceptionHandler.php
Expand Up @@ -6,20 +6,20 @@
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

trait ApiExceptionHandler {

trait ApiExceptionHandler
{
public function apiExceptions($request, Exception $exception)
{
if ($exception instanceof NotFoundHttpException) {
return response()->json([
'error' => [
'code' => 404,
'message' => 'Http not found',
]
],
], 404);
}

/**
/*
* Handle a failed validation attempt.
*
* @param \Illuminate\Contracts\Validation\Validator $validator
Expand All @@ -33,15 +33,15 @@ public function apiExceptions($request, Exception $exception)
'code' => 422,
'message' => $exception->getMessage(),
'errors' => $exception->errors(),
]
],
], 422);
}

return response()->json([
'error' => [
'code' => $exception->getCode(),
'message' => $exception->getMessage(),
]
],
], $exception->getCode());
}
}
1 change: 0 additions & 1 deletion app/Http/Requests/ApiFormRequest.php
Expand Up @@ -6,5 +6,4 @@

class ApiFormRequest extends FormRequest
{

}

0 comments on commit cad2311

Please sign in to comment.