From 77b1a258d9ed19aabf3aa2e2632c3b125d51c535 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Mon, 24 Apr 2017 16:56:38 -0400 Subject: [PATCH] Weekly fix of my StyleCI violations... --- app/Console/Commands/UpdateEnvironment.php | 2 +- app/Http/Controllers/Auth/LoginController.php | 2 -- app/Http/Controllers/Daemon/OptionController.php | 1 - app/Http/Controllers/Server/TaskController.php | 2 +- app/Jobs/SendScheduledTask.php | 4 +--- app/Repositories/DatabaseRepository.php | 1 - app/Repositories/ServerRepository.php | 3 +-- app/Repositories/TaskRepository.php | 1 - bootstrap/autoload.php | 2 +- database/migrations/2017_04_15_125021_UpgradeTaskSystem.php | 2 +- 10 files changed, 6 insertions(+), 14 deletions(-) diff --git a/app/Console/Commands/UpdateEnvironment.php b/app/Console/Commands/UpdateEnvironment.php index 3dd26442f..009efab2e 100644 --- a/app/Console/Commands/UpdateEnvironment.php +++ b/app/Console/Commands/UpdateEnvironment.php @@ -85,7 +85,7 @@ class UpdateEnvironment extends Command $variables['SERVICE_AUTHOR'] = (string) Uuid::generate(4); } - if(isset($variables['APP_THEME'])) { + if (isset($variables['APP_THEME'])) { if ($variables['APP_THEME'] === 'default') { $variables['APP_THEME'] = 'pterodactyl'; } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 23c012f73..cca632647 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -26,13 +26,11 @@ namespace Pterodactyl\Http\Controllers\Auth; use Auth; -use Alert; use Cache; use Crypt; use Illuminate\Http\Request; use Pterodactyl\Models\User; use PragmaRX\Google2FA\Google2FA; -use Pterodactyl\Events\Auth\FailedLogin; use Pterodactyl\Http\Controllers\Controller; use Illuminate\Foundation\Auth\AuthenticatesUsers; diff --git a/app/Http/Controllers/Daemon/OptionController.php b/app/Http/Controllers/Daemon/OptionController.php index 9a27c1c64..7d658672a 100644 --- a/app/Http/Controllers/Daemon/OptionController.php +++ b/app/Http/Controllers/Daemon/OptionController.php @@ -26,7 +26,6 @@ namespace Pterodactyl\Http\Controllers\Daemon; use Illuminate\Http\Request; use Pterodactyl\Models\Server; -use Pterodactyl\Models\ServiceOption; use Pterodactyl\Http\Controllers\Controller; class OptionController extends Controller diff --git a/app/Http/Controllers/Server/TaskController.php b/app/Http/Controllers/Server/TaskController.php index 8eebaa21d..a3908943a 100644 --- a/app/Http/Controllers/Server/TaskController.php +++ b/app/Http/Controllers/Server/TaskController.php @@ -28,9 +28,9 @@ use Log; use Alert; use Illuminate\Http\Request; use Pterodactyl\Models\Server; -use Pterodactyl\Repositories\TaskRepository; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Http\Controllers\Controller; +use Pterodactyl\Repositories\TaskRepository; use Pterodactyl\Exceptions\DisplayValidationException; class TaskController extends Controller diff --git a/app/Jobs/SendScheduledTask.php b/app/Jobs/SendScheduledTask.php index 167b8e250..525b670df 100644 --- a/app/Jobs/SendScheduledTask.php +++ b/app/Jobs/SendScheduledTask.php @@ -27,8 +27,6 @@ namespace Pterodactyl\Jobs; use Cron; use Carbon; use Pterodactyl\Models\Task; -use Pterodactyl\Models\User; -use Pterodactyl\Models\Server; use Pterodactyl\Models\TaskLog; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; @@ -77,7 +75,7 @@ class SendScheduledTask extends Job implements ShouldQueue if ($this->task->action === 'command') { $repo = new CommandRepository($this->task->server, $this->task->user); $response = $repo->send($this->task->data); - } else if ($this->task->action === 'power') { + } elseif ($this->task->action === 'power') { $repo = new PowerRepository($this->task->server, $this->task->user); $response = $repo->do($this->task->data); } else { diff --git a/app/Repositories/DatabaseRepository.php b/app/Repositories/DatabaseRepository.php index 27a096ddf..f7f428a6f 100644 --- a/app/Repositories/DatabaseRepository.php +++ b/app/Repositories/DatabaseRepository.php @@ -26,7 +26,6 @@ namespace Pterodactyl\Repositories; use DB; use Crypt; -use Config; use Validator; use Pterodactyl\Models\Server; use Pterodactyl\Models\Database; diff --git a/app/Repositories/ServerRepository.php b/app/Repositories/ServerRepository.php index 6aac53a0c..d3e4b0dfa 100644 --- a/app/Repositories/ServerRepository.php +++ b/app/Repositories/ServerRepository.php @@ -635,7 +635,6 @@ class ServerRepository */ protected function changeService($id, array $data) { - } protected function processVariables(Models\Server $server, $data, $admin = false) @@ -692,6 +691,7 @@ class ServerRepository // Reload Variables $server->load('variables'); + return $server->option->variables->map(function ($item, $key) use ($server) { $display = $server->variables->where('variable_id', $item->id)->pluck('variable_value')->first(); @@ -820,7 +820,6 @@ class ServerRepository return true; }); - } /** diff --git a/app/Repositories/TaskRepository.php b/app/Repositories/TaskRepository.php index 790078c22..24290e253 100644 --- a/app/Repositories/TaskRepository.php +++ b/app/Repositories/TaskRepository.php @@ -24,7 +24,6 @@ namespace Pterodactyl\Repositories; -use DB; use Cron; use Validator; use Pterodactyl\Models\Task; diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index 94adc9977..72354a655 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -14,4 +14,4 @@ define('LARAVEL_START', microtime(true)); | */ -require __DIR__.'/../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; diff --git a/database/migrations/2017_04_15_125021_UpgradeTaskSystem.php b/database/migrations/2017_04_15_125021_UpgradeTaskSystem.php index 16e4d4e9d..5264122b4 100644 --- a/database/migrations/2017_04_15_125021_UpgradeTaskSystem.php +++ b/database/migrations/2017_04_15_125021_UpgradeTaskSystem.php @@ -25,7 +25,7 @@ class UpgradeTaskSystem extends Migration }); DB::transaction(function () { - foreach(Task::all() as $task) { + foreach (Task::all() as $task) { $task->user_id = $task->server->owner_id; $task->save(); }