From b11029a666b0491c600811f34fcd7deba6139cee Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 18 Feb 2017 22:57:50 -0500 Subject: [PATCH] Apply fixes from StyleCI (#312) * Bump for release * Apply fixes from StyleCI --- app/Http/Controllers/Base/APIController.php | 1 + app/Policies/ServerPolicy.php | 3 +-- app/Repositories/APIRepository.php | 2 +- app/Repositories/Daemon/CommandRepository.php | 1 - app/Repositories/Daemon/PowerRepository.php | 1 - app/Repositories/ServerRepository.php | 4 ++-- app/Repositories/UserRepository.php | 5 ++--- config/app.php | 2 +- 8 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Base/APIController.php b/app/Http/Controllers/Base/APIController.php index e80f07033..68045a722 100644 --- a/app/Http/Controllers/Base/APIController.php +++ b/app/Http/Controllers/Base/APIController.php @@ -80,6 +80,7 @@ class APIController extends Controller return response('', 204); } catch (\Exception $ex) { Log::error($ex); + return response()->json([ 'error' => 'An error occured while attempting to remove this key.', ], 503); diff --git a/app/Policies/ServerPolicy.php b/app/Policies/ServerPolicy.php index adb4f3850..767dec13c 100644 --- a/app/Policies/ServerPolicy.php +++ b/app/Policies/ServerPolicy.php @@ -31,7 +31,6 @@ use Pterodactyl\Models\Server; class ServerPolicy { - /** * Create a new policy instance. * @@ -62,7 +61,7 @@ class ServerPolicy })->values(); }); - return ($permissions->search($permission, true) !== false); + return $permissions->search($permission, true) !== false; } /** diff --git a/app/Repositories/APIRepository.php b/app/Repositories/APIRepository.php index c18f1f993..5f148eda6 100644 --- a/app/Repositories/APIRepository.php +++ b/app/Repositories/APIRepository.php @@ -225,7 +225,7 @@ class APIRepository try { $model = Models\APIKey::with('permissions')->where('public', $key)->where('user_id', $this->user->id)->firstOrFail(); - foreach($model->permissions as &$permission) { + foreach ($model->permissions as &$permission) { $permission->delete(); } diff --git a/app/Repositories/Daemon/CommandRepository.php b/app/Repositories/Daemon/CommandRepository.php index 1905478e7..76ac93178 100644 --- a/app/Repositories/Daemon/CommandRepository.php +++ b/app/Repositories/Daemon/CommandRepository.php @@ -24,7 +24,6 @@ namespace Pterodactyl\Repositories\Daemon; -use GuzzleHttp\Client; use Pterodactyl\Models; use GuzzleHttp\Exception\RequestException; use Pterodactyl\Exceptions\DisplayException; diff --git a/app/Repositories/Daemon/PowerRepository.php b/app/Repositories/Daemon/PowerRepository.php index d43ec1a7d..b31c0cda0 100644 --- a/app/Repositories/Daemon/PowerRepository.php +++ b/app/Repositories/Daemon/PowerRepository.php @@ -24,7 +24,6 @@ namespace Pterodactyl\Repositories\Daemon; -use GuzzleHttp\Client; use Pterodactyl\Models; use Pterodactyl\Exceptions\DisplayException; diff --git a/app/Repositories/ServerRepository.php b/app/Repositories/ServerRepository.php index b6047739d..4b5ed1f15 100644 --- a/app/Repositories/ServerRepository.php +++ b/app/Repositories/ServerRepository.php @@ -791,8 +791,8 @@ class ServerRepository Models\ServerVariable::where('server_id', $server->id)->delete(); // Remove SubUsers - foreach(Models\Subuser::with('permissions')->where('server_id', $server->id)->get() as &$subuser) { - foreach($subuser->permissions as &$permission) { + foreach (Models\Subuser::with('permissions')->where('server_id', $server->id)->get() as &$subuser) { + foreach ($subuser->permissions as &$permission) { $permission->delete(); } $subuser->delete(); diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index c59637783..e9cd8580f 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -34,7 +34,6 @@ use Validator; use Pterodactyl\Models; use Pterodactyl\Services\UuidService; use Pterodactyl\Exceptions\DisplayException; -use Pterodactyl\Notifications\AccountCreated; use Pterodactyl\Exceptions\DisplayValidationException; class UserRepository @@ -177,8 +176,8 @@ class UserRepository DB::beginTransaction(); try { - foreach(Models\Subuser::with('permissions')->where('user_id', $id)->get() as &$subuser) { - foreach($subuser->permissions as &$permission) { + foreach (Models\Subuser::with('permissions')->where('user_id', $id)->get() as &$subuser) { + foreach ($subuser->permissions as &$permission) { $permission->delete(); } diff --git a/config/app.php b/config/app.php index 622098a9b..e6b955156 100644 --- a/config/app.php +++ b/config/app.php @@ -4,7 +4,7 @@ return [ 'env' => env('APP_ENV', 'production'), - 'version' => env('APP_VERSION', 'canary'), + 'version' => env('APP_VERSION', '0.6.0-pre.4'), 'phrase_in_context' => env('PHRASE_IN_CONTEXT', false),