From 25d9ba4779755875b369dfaf9c6fe91d360c67ef Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 15 Aug 2021 17:20:36 -0700 Subject: [PATCH] Run php-cs-fixer --- .php-cs-fixer.dist.php | 10 +++++++++- .../Api/Client/Servers/BackupController.php | 2 +- .../Client/Servers/ResourceUtilizationController.php | 6 ------ .../Api/Remote/Servers/ServerDetailsController.php | 1 - .../Api/Remote/Servers/ServerInstallController.php | 2 +- app/Models/Backup.php | 2 +- app/Repositories/Eloquent/BackupRepository.php | 2 -- app/Services/Backups/InitiateBackupService.php | 5 ----- config/database.php | 2 +- config/services.php | 2 +- ...21_02_23_205021_add_index_for_server_and_action.php | 4 ++-- .../2021_02_23_212657_make_sftp_port_unsigned_int.php | 4 ++-- ...force_cron_month_field_to_have_value_if_missing.php | 4 ++-- ..._092457_add_continue_on_failure_option_to_tasks.php | 4 ++-- ...only_run_when_server_online_option_to_schedules.php | 4 ++-- ...1_05_03_201016_add_support_for_locking_a_backup.php | 4 ++-- .../2021_07_12_013420_remove_userinteraction.php | 1 + .../Api/Client/ClientApiIntegrationTestCase.php | 1 - .../ScheduleTask/CreateServerScheduleTaskTest.php | 2 +- tests/Integration/Jobs/Schedule/RunTaskJobTest.php | 5 ++--- .../Services/Servers/BuildModificationServiceTest.php | 1 - 21 files changed, 30 insertions(+), 38 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 97d0c648..7c767681 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -3,7 +3,15 @@ use PhpCsFixer\Config; use PhpCsFixer\Finder; -$finder = (new Finder())->in(__DIR__)->exclude(['vendor', 'node_modules', 'storage', 'bootstrap/cache']); +$finder = (new Finder()) + ->in(__DIR__) + ->exclude([ + 'vendor', + 'node_modules', + 'storage', + 'bootstrap/cache', + ]) + ->notName(['_ide_helper*']); return (new Config()) ->setRiskyAllowed(true) diff --git a/app/Http/Controllers/Api/Client/Servers/BackupController.php b/app/Http/Controllers/Api/Client/Servers/BackupController.php index 7f4c6380..67b54cd2 100644 --- a/app/Http/Controllers/Api/Client/Servers/BackupController.php +++ b/app/Http/Controllers/Api/Client/Servers/BackupController.php @@ -11,8 +11,8 @@ use Pterodactyl\Models\Permission; use Illuminate\Auth\Access\AuthorizationException; use Pterodactyl\Services\Backups\DeleteBackupService; use Pterodactyl\Services\Backups\DownloadLinkService; -use Pterodactyl\Services\Backups\InitiateBackupService; use Pterodactyl\Repositories\Eloquent\BackupRepository; +use Pterodactyl\Services\Backups\InitiateBackupService; use Pterodactyl\Repositories\Wings\DaemonBackupRepository; use Pterodactyl\Transformers\Api\Client\BackupTransformer; use Pterodactyl\Http\Controllers\Api\Client\ClientApiController; diff --git a/app/Http/Controllers/Api/Client/Servers/ResourceUtilizationController.php b/app/Http/Controllers/Api/Client/Servers/ResourceUtilizationController.php index 5b80768b..d2862239 100644 --- a/app/Http/Controllers/Api/Client/Servers/ResourceUtilizationController.php +++ b/app/Http/Controllers/Api/Client/Servers/ResourceUtilizationController.php @@ -12,14 +12,8 @@ use Pterodactyl\Http\Requests\Api\Client\Servers\GetServerRequest; class ResourceUtilizationController extends ClientApiController { - /** - * @var \Pterodactyl\Repositories\Wings\DaemonServerRepository - */ private DaemonServerRepository $repository; - /** - * @var \Illuminate\Cache\Repository - */ private Repository $cache; /** diff --git a/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php b/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php index 7e3790e7..6b49fafa 100644 --- a/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php +++ b/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php @@ -93,7 +93,6 @@ class ServerDetailsController extends Controller * do not get incorrectly stuck in installing/restoring from backup states since * a Wings reboot would completely stop those processes. * - * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\JsonResponse * * @throws \Throwable diff --git a/app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php b/app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php index fc3e04b7..be67ee53 100644 --- a/app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php +++ b/app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php @@ -8,9 +8,9 @@ use Pterodactyl\Models\Server; use Illuminate\Http\JsonResponse; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Repositories\Eloquent\ServerRepository; -use Pterodactyl\Http\Requests\Api\Remote\InstallationDataRequest; use Pterodactyl\Events\Server\Installed as ServerInstalled; use Illuminate\Contracts\Events\Dispatcher as EventDispatcher; +use Pterodactyl\Http\Requests\Api\Remote\InstallationDataRequest; class ServerInstallController extends Controller { diff --git a/app/Models/Backup.php b/app/Models/Backup.php index 9ad03fd3..f608edc7 100644 --- a/app/Models/Backup.php +++ b/app/Models/Backup.php @@ -107,6 +107,6 @@ class Backup extends Model { return $this->hasMany(AuditLog::class, 'metadata->backup_uuid', 'uuid') ->where('action', 'LIKE', 'server:backup.%'); - // ->where('metadata->backup_uuid', $this->uuid); + // ->where('metadata->backup_uuid', $this->uuid); } } diff --git a/app/Repositories/Eloquent/BackupRepository.php b/app/Repositories/Eloquent/BackupRepository.php index 7efdace0..051d0ce4 100644 --- a/app/Repositories/Eloquent/BackupRepository.php +++ b/app/Repositories/Eloquent/BackupRepository.php @@ -38,8 +38,6 @@ class BackupRepository extends EloquentRepository /** * Returns a query filtering only non-failed backups for a specific server. - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function getNonFailedBackups(Server $server): HasMany { diff --git a/app/Services/Backups/InitiateBackupService.php b/app/Services/Backups/InitiateBackupService.php index 8bad8f4f..705bdf42 100644 --- a/app/Services/Backups/InitiateBackupService.php +++ b/app/Services/Backups/InitiateBackupService.php @@ -9,7 +9,6 @@ use Pterodactyl\Models\Backup; use Pterodactyl\Models\Server; use Illuminate\Database\ConnectionInterface; use Pterodactyl\Extensions\Backups\BackupManager; -use Illuminate\Database\Eloquent\Relations\HasMany; use Pterodactyl\Repositories\Eloquent\BackupRepository; use Pterodactyl\Repositories\Wings\DaemonBackupRepository; use Pterodactyl\Exceptions\Service\Backup\TooManyBackupsException; @@ -55,11 +54,7 @@ class InitiateBackupService /** * InitiateBackupService constructor. * - * @param \Pterodactyl\Repositories\Eloquent\BackupRepository $repository - * @param \Illuminate\Database\ConnectionInterface $connection - * @param \Pterodactyl\Repositories\Wings\DaemonBackupRepository $daemonBackupRepository * @param \Pterodactyl\Services\Backups\DeleteBackupService $deleteBackupService - * @param \Pterodactyl\Extensions\Backups\BackupManager $backupManager */ public function __construct( BackupRepository $repository, diff --git a/config/database.php b/config/database.php index 68f65a2e..a4b01139 100644 --- a/config/database.php +++ b/config/database.php @@ -111,7 +111,7 @@ return [ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), ], 'default' => [ diff --git a/config/services.php b/config/services.php index b15f7bf0..39b8116c 100644 --- a/config/services.php +++ b/config/services.php @@ -16,7 +16,7 @@ return [ 'mailgun' => [ 'domain' => env('MAILGUN_DOMAIN'), 'secret' => env('MAILGUN_SECRET'), - 'endpoint' => env('MAILGUN_ENDPOINT') + 'endpoint' => env('MAILGUN_ENDPOINT'), ], 'mandrill' => [ diff --git a/database/migrations/2021_02_23_205021_add_index_for_server_and_action.php b/database/migrations/2021_02_23_205021_add_index_for_server_and_action.php index 9bf0a34e..88812546 100644 --- a/database/migrations/2021_02_23_205021_add_index_for_server_and_action.php +++ b/database/migrations/2021_02_23_205021_add_index_for_server_and_action.php @@ -1,8 +1,8 @@