@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace App\Modules\Acl\Http\Controllers; |
3 | 3 | |
4 | -use Illuminate\Foundation\Http\FormRequest; |
|
5 | 4 | use App\Modules\Core\Http\Controllers\BaseApiController; |
6 | 5 | use Illuminate\Http\Request; |
7 | 6 |
@@ -52,32 +52,26 @@ |
||
52 | 52 | { |
53 | 53 | $error = \ErrorHandler::dbQueryError(); |
54 | 54 | return \Response::json($error['message'], $error['status']); |
55 | - } |
|
56 | - else if ($e instanceof \predis\connection\connectionexception) |
|
55 | + } else if ($e instanceof \predis\connection\connectionexception) |
|
57 | 56 | { |
58 | 57 | $error = \ErrorHandler::redisNotRunning(); |
59 | 58 | return \Response::json($error['message'], $error['status']); |
60 | - } |
|
61 | - else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) |
|
59 | + } else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) |
|
62 | 60 | { |
63 | 61 | $error = \ErrorHandler::tokenExpired(); |
64 | 62 | return \Response::json($error['message'], $error['status']); |
65 | - } |
|
66 | - else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) |
|
63 | + } else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) |
|
67 | 64 | { |
68 | 65 | $error = \ErrorHandler::noPermissions(); |
69 | 66 | return \Response::json($error['message'], $error['status']); |
70 | - } |
|
71 | - else if ($e instanceof \Tymon\JWTAuth\Exceptions\JWTException) |
|
67 | + } else if ($e instanceof \Tymon\JWTAuth\Exceptions\JWTException) |
|
72 | 68 | { |
73 | 69 | $error = \ErrorHandler::unAuthorized(); |
74 | 70 | return \Response::json($error['message'], $error['status']); |
75 | - } |
|
76 | - else if ($e instanceof HttpException) |
|
71 | + } else if ($e instanceof HttpException) |
|
77 | 72 | { |
78 | 73 | return \Response::json($e->getMessage(), $e->getStatusCode()); |
79 | - } |
|
80 | - else |
|
74 | + } else |
|
81 | 75 | { |
82 | 76 | return parent::render($request, $e); |
83 | 77 | } |
@@ -190,8 +190,7 @@ discard block |
||
190 | 190 | if ($request->has('id')) |
191 | 191 | { |
192 | 192 | $rule = str_replace('{id}', $request->get('id'), $rule); |
193 | - } |
|
194 | - else |
|
193 | + } else |
|
195 | 194 | { |
196 | 195 | $rule = str_replace(',{id}', '', $rule); |
197 | 196 | } |
@@ -232,8 +231,7 @@ discard block |
||
232 | 231 | { |
233 | 232 | $error = $this->errorHandler->notFound('method'); |
234 | 233 | abort($error['status'], $error['message']); |
235 | - } |
|
236 | - else if ( ! in_array($permission, $this->skipLoginCheck)) |
|
234 | + } else if ( ! in_array($permission, $this->skipLoginCheck)) |
|
237 | 235 | { |
238 | 236 | \JWTAuth::parseToken()->authenticate(); |
239 | 237 | if ( ! in_array($permission, $this->skipPermissionCheck) && ! \Core::users()->can($permission, $this->model)) |