Unverified Commit 41983ea1 authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #169 from viralsolani/analysis-XplWZW

Apply fixes from StyleCI
parents 78a91df2 a30d7ba8
...@@ -61,20 +61,20 @@ class Handler extends ExceptionHandler ...@@ -61,20 +61,20 @@ class Handler extends ExceptionHandler
return response()->json([ return response()->json([
'status' => 'error', 'status' => 'error',
'error' => 'Token has not been provided', 'error' => 'Token has not been provided',
'data' => json_decode("{}"), 'data' => json_decode('{}'),
], $exception->getStatusCode()); ], $exception->getStatusCode());
case \Tymon\JWTAuth\Exceptions\TokenExpiredException::class: case \Tymon\JWTAuth\Exceptions\TokenExpiredException::class:
return response()->json([ return response()->json([
'status' => 'error', 'status' => 'error',
'error' => 'Token has expired', 'error' => 'Token has expired',
'data' => json_decode("{}"), 'data' => json_decode('{}'),
], $exception->getStatusCode()); ], $exception->getStatusCode());
case \Tymon\JWTAuth\Exceptions\TokenInvalidException::class: case \Tymon\JWTAuth\Exceptions\TokenInvalidException::class:
case \Tymon\JWTAuth\Exceptions\TokenBlacklistedException::class: case \Tymon\JWTAuth\Exceptions\TokenBlacklistedException::class:
return response()->json([ return response()->json([
'status' => 'error', 'status' => 'error',
'error' => 'Token is invalid', 'error' => 'Token is invalid',
'data' => json_decode("{}"), 'data' => json_decode('{}'),
], $exception->getStatusCode()); ], $exception->getStatusCode());
default: default:
break; break;
...@@ -145,7 +145,6 @@ class Handler extends ExceptionHandler ...@@ -145,7 +145,6 @@ class Handler extends ExceptionHandler
*/ */
protected function unauthenticated($request, AuthenticationException $exception) protected function unauthenticated($request, AuthenticationException $exception)
{ {
if ($request->expectsJson()) { if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401); return response()->json(['error' => 'Unauthenticated.'], 401);
} }
......
...@@ -178,7 +178,6 @@ class APIController extends Controller ...@@ -178,7 +178,6 @@ class APIController extends Controller
return $this->setStatusCode(204)->respond(null); return $this->setStatusCode(204)->respond(null);
} }
/**Note this function is same as the below function but instead of responding with error below function returns error json /**Note this function is same as the below function but instead of responding with error below function returns error json
* Throw Validation. * Throw Validation.
* *
...@@ -201,6 +200,6 @@ class APIController extends Controller ...@@ -201,6 +200,6 @@ class APIController extends Controller
*/ */
public function throwValidation($validation) public function throwValidation($validation)
{ {
return ["error"=>$validation->errors()]; return ['error'=>$validation->errors()];
} }
} }
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
namespace App\Http\Controllers\Api\V1; namespace App\Http\Controllers\Api\V1;
use App\Http\Requests\Backend\BlogTags\StoreApiBlogTagsRequest;
use App\Http\Resources\BlogTagsResource; use App\Http\Resources\BlogTagsResource;
use App\Models\BlogTags\BlogTag; use App\Models\BlogTags\BlogTag;
use App\Repositories\Backend\BlogTags\BlogTagsRepository; use App\Repositories\Backend\BlogTags\BlogTagsRepository;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Http\Requests\Backend\BlogTags\StoreApiBlogTagsRequest;
use Validator; use Validator;
use Exception;
class BlogTagsController extends APIController class BlogTagsController extends APIController
{ {
...@@ -75,8 +74,6 @@ class BlogTagsController extends APIController ...@@ -75,8 +74,6 @@ class BlogTagsController extends APIController
* @param Request $request * @param Request $request
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*
*
*/ */
// public function store(StoreApiBlogTagsRequest $request) // public function store(StoreApiBlogTagsRequest $request)
// { // {
......
...@@ -2,17 +2,14 @@ ...@@ -2,17 +2,14 @@
namespace App\Http\Controllers\Api\V1; namespace App\Http\Controllers\Api\V1;
use App\Events\Backend\Access\User\UserCreated;
use App\Events\Backend\Access\User\UserUpdated;
use App\Http\Resources\UserResource; use App\Http\Resources\UserResource;
use App\Models\Access\User\User;
use App\Repositories\Backend\Access\User\UserRepository; use App\Repositories\Backend\Access\User\UserRepository;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Validator;
class DeactivatedUsersController extends APIController class DeactivatedUsersController extends APIController
{ {
protected $repository; protected $repository;
/** /**
* __construct. * __construct.
* *
......
...@@ -2,17 +2,14 @@ ...@@ -2,17 +2,14 @@
namespace App\Http\Controllers\Api\V1; namespace App\Http\Controllers\Api\V1;
use App\Events\Backend\Access\User\UserCreated;
use App\Events\Backend\Access\User\UserUpdated;
use App\Http\Resources\UserResource; use App\Http\Resources\UserResource;
use App\Models\Access\User\User;
use App\Repositories\Backend\Access\User\UserRepository; use App\Repositories\Backend\Access\User\UserRepository;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Validator;
class DeletedUsersController extends APIController class DeletedUsersController extends APIController
{ {
protected $repository; protected $repository;
/** /**
* __construct. * __construct.
* *
...@@ -38,5 +35,4 @@ class DeletedUsersController extends APIController ...@@ -38,5 +35,4 @@ class DeletedUsersController extends APIController
$this->repository->getForDataTable(0, true)->paginate($limit) $this->repository->getForDataTable(0, true)->paginate($limit)
); );
} }
} }
...@@ -22,7 +22,6 @@ class RolesController extends APIController ...@@ -22,7 +22,6 @@ class RolesController extends APIController
$this->repository = $repository; $this->repository = $repository;
} }
/** /**
* Return the roles. * Return the roles.
* *
...@@ -115,7 +114,6 @@ class RolesController extends APIController ...@@ -115,7 +114,6 @@ class RolesController extends APIController
* *
* @return Validator object * @return Validator object
*/ */
public function validateRole(Request $request) public function validateRole(Request $request)
{ {
$permissions = ''; $permissions = '';
......
...@@ -26,7 +26,6 @@ class StoreApiBlogTagsRequest extends Request ...@@ -26,7 +26,6 @@ class StoreApiBlogTagsRequest extends Request
*/ */
public function rules() public function rules()
{ {
return [ return [
'name' => 'required|max:191', 'name' => 'required|max:191',
]; ];
......
...@@ -28,13 +28,12 @@ Route::group(['namespace' => 'Api\V1', 'prefix' => 'v1', 'as' => 'v1.'], functio ...@@ -28,13 +28,12 @@ Route::group(['namespace' => 'Api\V1', 'prefix' => 'v1', 'as' => 'v1.'], functio
// Route::post('password/reset', 'ResetPasswordController@reset')->name('password.reset'); // Route::post('password/reset', 'ResetPasswordController@reset')->name('password.reset');
}); });
// Users // Users
Route::resource('users', 'UsersController', ['except' => ['create','edit']]); Route::resource('users', 'UsersController', ['except' => ['create', 'edit']]);
Route::get('deactivatedUsers', 'DeactivatedUsersController@index'); Route::get('deactivatedUsers', 'DeactivatedUsersController@index');
Route::get('deletedUsers', 'DeletedUsersController@index'); Route::get('deletedUsers', 'DeletedUsersController@index');
// Roles // Roles
Route::resource('roles', 'RolesController' , ['except' => ['create', 'edit']]); Route::resource('roles', 'RolesController', ['except' => ['create', 'edit']]);
// Permission // Permission
Route::resource('permission', 'PermissionController'); Route::resource('permission', 'PermissionController');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment