diff --git a/app/Console/Commands/Environment/EmailSettingsCommand.php b/app/Console/Commands/Environment/EmailSettingsCommand.php index b8604757f..add1296e6 100644 --- a/app/Console/Commands/Environment/EmailSettingsCommand.php +++ b/app/Console/Commands/Environment/EmailSettingsCommand.php @@ -65,14 +65,14 @@ class EmailSettingsCommand extends Command public function handle() { $this->variables['MAIL_DRIVER'] = $this->option('driver') ?? $this->choice( - trans('command/messages.environment.mail.ask_driver'), [ + trans('command/messages.environment.mail.ask_driver'), [ 'smtp' => 'SMTP Server', 'mail' => 'PHP\'s Internal Mail Function', 'mailgun' => 'Mailgun Transactional Email', 'mandrill' => 'Mandrill Transactional Email', 'postmark' => 'Postmarkapp Transactional Email', ], $this->config->get('mail.driver', 'smtp') - ); + ); $method = 'setup' . studly_case($this->variables['MAIL_DRIVER']) . 'DriverVariables'; if (method_exists($this, $method)) { diff --git a/app/Http/Controllers/Admin/DatabaseController.php b/app/Http/Controllers/Admin/DatabaseController.php index 569fec1d7..0aee86806 100644 --- a/app/Http/Controllers/Admin/DatabaseController.php +++ b/app/Http/Controllers/Admin/DatabaseController.php @@ -165,6 +165,7 @@ class DatabaseController extends Controller $this->alert->danger( sprintf('There was an error while trying to connect to the host or while executing a query: "%s"', $exception->getMessage()) )->flash(); + return $redirect->withInput($request->normalize()); } else { throw $exception; diff --git a/app/Http/Controllers/Api/Client/Servers/ScheduleTaskController.php b/app/Http/Controllers/Api/Client/Servers/ScheduleTaskController.php index 340e2541a..7461a950a 100644 --- a/app/Http/Controllers/Api/Client/Servers/ScheduleTaskController.php +++ b/app/Http/Controllers/Api/Client/Servers/ScheduleTaskController.php @@ -86,7 +86,7 @@ class ScheduleTaskController extends ClientApiController } $this->repository->update($task->id, [ - 'action' => $request->input('action'), + 'action' => $request->input('action'), 'payload' => $request->input('payload'), 'time_offset' => $request->input('time_offset'), ]); diff --git a/app/Http/Controllers/Api/Remote/Servers/ServerBackupController.php b/app/Http/Controllers/Api/Remote/Servers/ServerBackupController.php index b4599ee0a..8daee56af 100644 --- a/app/Http/Controllers/Api/Remote/Servers/ServerBackupController.php +++ b/app/Http/Controllers/Api/Remote/Servers/ServerBackupController.php @@ -3,8 +3,6 @@ namespace Pterodactyl\Http\Controllers\Api\Remote\Servers; use Carbon\Carbon; -use Illuminate\Http\Request; -use Pterodactyl\Models\Server; use Illuminate\Http\JsonResponse; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Repositories\Eloquent\BackupRepository; diff --git a/app/Services/Nodes/NodeUpdateService.php b/app/Services/Nodes/NodeUpdateService.php index 8ce610df9..f2fb76be7 100644 --- a/app/Services/Nodes/NodeUpdateService.php +++ b/app/Services/Nodes/NodeUpdateService.php @@ -8,7 +8,6 @@ use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; use Illuminate\Database\ConnectionInterface; use Illuminate\Contracts\Encryption\Encrypter; -use Pterodactyl\Repositories\Daemon\ConfigurationRepository; use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; use Pterodactyl\Repositories\Wings\DaemonConfigurationRepository; use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException; diff --git a/config/ide-helper.php b/config/ide-helper.php index 9f10873f6..5922f533c 100644 --- a/config/ide-helper.php +++ b/config/ide-helper.php @@ -168,8 +168,8 @@ return [ | Cast the given "real type" to the given "type". | */ - 'type_overrides' => [ + 'type_overrides' => [ 'integer' => 'int', 'boolean' => 'bool', - ], + ], ]; diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 3b2d3e728..93fbac555 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -3,8 +3,8 @@ use Ramsey\Uuid\Uuid; use Cake\Chronos\Chronos; use Illuminate\Support\Str; -use Faker\Generator as Faker; use Pterodactyl\Models\Node; +use Faker\Generator as Faker; use Pterodactyl\Models\ApiKey; /* diff --git a/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php b/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php index 6bb36813d..dffa7687a 100644 --- a/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php +++ b/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php @@ -26,8 +26,8 @@ class ChangeServicesToUseAMoreUniqueIdentifier extends Migration DB::table('services')->get(['id', 'author', 'uuid'])->each(function ($service) { DB::table('services')->where('id', $service->id)->update([ - 'author' => ($service->author === 'ptrdctyl-v040-11e6-8b77-86f30ca893d3') ? 'support@pterodactyl.io' : 'unknown@unknown-author.com', - 'uuid' => Uuid::uuid4()->toString(), + 'author' => ($service->author === 'ptrdctyl-v040-11e6-8b77-86f30ca893d3') ? 'support@pterodactyl.io' : 'unknown@unknown-author.com', + 'uuid' => Uuid::uuid4()->toString(), ]); }); diff --git a/database/migrations/2020_03_22_163911_merge_permissions_table_into_subusers.php b/database/migrations/2020_03_22_163911_merge_permissions_table_into_subusers.php index 7cd0c5fce..621c9526b 100644 --- a/database/migrations/2020_03_22_163911_merge_permissions_table_into_subusers.php +++ b/database/migrations/2020_03_22_163911_merge_permissions_table_into_subusers.php @@ -44,12 +44,12 @@ class MergePermissionsTableIntoSubusers extends Migration { foreach (DB::select('SELECT id, permissions FROM subusers') as $datum) { $values = []; - foreach(json_decode($datum->permissions, true) as $permission) { + foreach (json_decode($datum->permissions, true) as $permission) { $values[] = $datum->id; $values[] = $permission; } - if (!empty($values)) { + if (! empty($values)) { $string = 'VALUES ' . implode(', ', array_fill(0, count($values) / 2, '(?, ?)')); DB::insert('INSERT INTO permissions(`subuser_id`, `permission`) ' . $string, $values); diff --git a/database/migrations/2020_04_03_230614_create_backups_table.php b/database/migrations/2020_04_03_230614_create_backups_table.php index 63dad39a0..ead68105c 100644 --- a/database/migrations/2020_04_03_230614_create_backups_table.php +++ b/database/migrations/2020_04_03_230614_create_backups_table.php @@ -1,8 +1,8 @@ make(); $this->repository->shouldReceive('withoutFreshModel->update')->with($model->id, [ - 'locked' => false, - 'visible' => false, - 'selectable' => false, - 'test-data' => 'value', - ])->once()->andReturn(1); + 'locked' => false, + 'visible' => false, + 'selectable' => false, + 'test-data' => 'value', + ])->once()->andReturn(1); $this->assertEquals(1, $this->service->handle($model, ['test-data' => 'value'])); } @@ -88,11 +88,11 @@ class PackUpdateServiceTest extends TestCase $this->repository->shouldReceive('setColumns')->with(['id', 'egg_id'])->once()->andReturnSelf() ->shouldReceive('find')->with($model->id)->once()->andReturn($model); $this->repository->shouldReceive('withoutFreshModel->update')->with($model->id, [ - 'locked' => false, - 'visible' => false, - 'selectable' => false, - 'test-data' => 'value', - ])->once()->andReturn(1); + 'locked' => false, + 'visible' => false, + 'selectable' => false, + 'test-data' => 'value', + ])->once()->andReturn(1); $this->assertEquals(1, $this->service->handle($model->id, ['test-data' => 'value'])); }