diff --git a/app/Console/Commands/Environment/EmailSettingsCommand.php b/app/Console/Commands/Environment/EmailSettingsCommand.php index fe7f1a879..f15ac18ba 100644 --- a/app/Console/Commands/Environment/EmailSettingsCommand.php +++ b/app/Console/Commands/Environment/EmailSettingsCommand.php @@ -29,7 +29,7 @@ class EmailSettingsCommand extends Command * * @throws \App\Exceptions\PanelException */ - public function handle() + public function handle(): void { $this->variables['MAIL_DRIVER'] = $this->option('driver') ?? $this->choice( trans('command/messages.environment.mail.ask_driver'), diff --git a/app/Console/Commands/InfoCommand.php b/app/Console/Commands/InfoCommand.php index 31945bed9..865f408f0 100644 --- a/app/Console/Commands/InfoCommand.php +++ b/app/Console/Commands/InfoCommand.php @@ -22,7 +22,7 @@ class InfoCommand extends Command /** * Handle execution of command. */ - public function handle() + public function handle(): void { $this->output->title('Version Information'); $this->table([], [ diff --git a/app/Console/Commands/Maintenance/CleanServiceBackupFilesCommand.php b/app/Console/Commands/Maintenance/CleanServiceBackupFilesCommand.php index 57d0770b8..7a54c0b54 100644 --- a/app/Console/Commands/Maintenance/CleanServiceBackupFilesCommand.php +++ b/app/Console/Commands/Maintenance/CleanServiceBackupFilesCommand.php @@ -30,7 +30,7 @@ class CleanServiceBackupFilesCommand extends Command /** * Handle command execution. */ - public function handle() + public function handle(): void { $files = $this->disk->files('services/.bak'); diff --git a/app/Console/Commands/Maintenance/PruneOrphanedBackupsCommand.php b/app/Console/Commands/Maintenance/PruneOrphanedBackupsCommand.php index 8c10995e7..90880e947 100644 --- a/app/Console/Commands/Maintenance/PruneOrphanedBackupsCommand.php +++ b/app/Console/Commands/Maintenance/PruneOrphanedBackupsCommand.php @@ -12,7 +12,7 @@ class PruneOrphanedBackupsCommand extends Command protected $description = 'Marks all backups older than "n" minutes that have not yet completed as being failed.'; - public function handle() + public function handle(): void { $since = $this->option('prune-age') ?? config('backups.prune_age', 360); if (!$since || !is_digit($since)) { diff --git a/app/Console/Commands/Node/MakeNodeCommand.php b/app/Console/Commands/Node/MakeNodeCommand.php index 5abf45f40..6c370fa28 100644 --- a/app/Console/Commands/Node/MakeNodeCommand.php +++ b/app/Console/Commands/Node/MakeNodeCommand.php @@ -40,7 +40,7 @@ class MakeNodeCommand extends Command * * @throws \App\Exceptions\Model\DataValidationException */ - public function handle() + public function handle(): void { $data['name'] = $this->option('name') ?? $this->ask('Enter a short identifier used to distinguish this node from others'); $data['description'] = $this->option('description') ?? $this->ask('Enter a description to identify the node'); diff --git a/app/Console/Commands/Overrides/KeyGenerateCommand.php b/app/Console/Commands/Overrides/KeyGenerateCommand.php index 3abf4871d..d837c7b46 100644 --- a/app/Console/Commands/Overrides/KeyGenerateCommand.php +++ b/app/Console/Commands/Overrides/KeyGenerateCommand.php @@ -10,7 +10,7 @@ class KeyGenerateCommand extends BaseKeyGenerateCommand * Override the default Laravel key generation command to throw a warning to the user * if it appears that they have already generated an application encryption key. */ - public function handle() + public function handle(): void { if (!empty(config('app.key')) && $this->input->isInteractive()) { $this->output->warning('It appears you have already configured an application encryption key. Continuing with this process with overwrite that key and cause data corruption for any existing encrypted data. DO NOT CONTINUE UNLESS YOU KNOW WHAT YOU ARE DOING.'); diff --git a/app/Console/Commands/Server/BulkPowerActionCommand.php b/app/Console/Commands/Server/BulkPowerActionCommand.php index 6d463d196..4f95278fe 100644 --- a/app/Console/Commands/Server/BulkPowerActionCommand.php +++ b/app/Console/Commands/Server/BulkPowerActionCommand.php @@ -32,7 +32,7 @@ class BulkPowerActionCommand extends Command * * @throws \Illuminate\Validation\ValidationException */ - public function handle() + public function handle(): void { $action = $this->argument('action'); $nodes = empty($this->option('nodes')) ? [] : explode(',', $this->option('nodes')); diff --git a/app/Console/Commands/UpgradeCommand.php b/app/Console/Commands/UpgradeCommand.php index c2a7a313f..45c127767 100644 --- a/app/Console/Commands/UpgradeCommand.php +++ b/app/Console/Commands/UpgradeCommand.php @@ -30,7 +30,7 @@ class UpgradeCommand extends Command * * @throws \Exception */ - public function handle() + public function handle(): void { $skipDownload = $this->option('skip-download'); if (!$skipDownload) { diff --git a/app/Console/Commands/User/DisableTwoFactorCommand.php b/app/Console/Commands/User/DisableTwoFactorCommand.php index 44ff08356..8a14c81fd 100644 --- a/app/Console/Commands/User/DisableTwoFactorCommand.php +++ b/app/Console/Commands/User/DisableTwoFactorCommand.php @@ -16,7 +16,7 @@ class DisableTwoFactorCommand extends Command * * @throws \App\Exceptions\Model\DataValidationException */ - public function handle() + public function handle(): void { if ($this->input->isInteractive()) { $this->output->warning(trans('command/messages.user.2fa_help_text')); diff --git a/app/Console/Commands/User/MakeUserCommand.php b/app/Console/Commands/User/MakeUserCommand.php index f9450d53e..4751e0d31 100644 --- a/app/Console/Commands/User/MakeUserCommand.php +++ b/app/Console/Commands/User/MakeUserCommand.php @@ -27,7 +27,7 @@ class MakeUserCommand extends Command * @throws Exception * @throws \App\Exceptions\Model\DataValidationException */ - public function handle() + public function handle(): int { try { DB::select('select 1 where 1'); diff --git a/app/Http/Middleware/Activity/AccountSubject.php b/app/Http/Middleware/Activity/AccountSubject.php index 80067f247..a538cd81c 100644 --- a/app/Http/Middleware/Activity/AccountSubject.php +++ b/app/Http/Middleware/Activity/AccountSubject.php @@ -2,8 +2,9 @@ namespace App\Http\Middleware\Activity; -use Illuminate\Http\Request; use App\Facades\LogTarget; +use Illuminate\Http\Request; +use Symfony\Component\HttpFoundation\Response; class AccountSubject { @@ -11,7 +12,7 @@ class AccountSubject * Sets the actor and default subject for all requests passing through this * middleware to be the currently logged in user. */ - public function handle(Request $request, \Closure $next) + public function handle(Request $request, \Closure $next): Response { LogTarget::setActor($request->user()); LogTarget::setSubject($request->user()); diff --git a/app/Http/Middleware/Activity/ServerSubject.php b/app/Http/Middleware/Activity/ServerSubject.php index 26f6fc5ce..3f0c45f13 100644 --- a/app/Http/Middleware/Activity/ServerSubject.php +++ b/app/Http/Middleware/Activity/ServerSubject.php @@ -2,21 +2,22 @@ namespace App\Http\Middleware\Activity; -use Illuminate\Http\Request; use App\Models\Server; use App\Facades\LogTarget; +use Illuminate\Http\Request; +use Symfony\Component\HttpFoundation\Response; class ServerSubject { /** - * Attempts to automatically scope all of the activity log events registered + * Attempts to automatically scope all the activity log events registered * within the request instance to the given user and server. This only sets * the actor and subject if there is a server present on the request. * * If no server is found this is a no-op as the activity log service can always * set the user based on the authmanager response. */ - public function handle(Request $request, \Closure $next) + public function handle(Request $request, \Closure $next): Response { $server = $request->route()->parameter('server'); if ($server instanceof Server) { diff --git a/app/Http/Middleware/Api/Client/SubstituteClientBindings.php b/app/Http/Middleware/Api/Client/SubstituteClientBindings.php index 06f58cd81..ea9099260 100644 --- a/app/Http/Middleware/Api/Client/SubstituteClientBindings.php +++ b/app/Http/Middleware/Api/Client/SubstituteClientBindings.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware\Api\Client; +use Illuminate\Http\Request; use App\Models\Server; use Illuminate\Contracts\Routing\Registrar; use Illuminate\Routing\Middleware\SubstituteBindings; @@ -13,7 +14,7 @@ class SubstituteClientBindings extends SubstituteBindings parent::__construct($router); } - public function handle($request, \Closure $next): mixed + public function handle(Request $request, \Closure $next): mixed { // Override default behavior of the model binding to use a specific table // column rather than the default 'id'. diff --git a/app/Jobs/Schedule/RunTaskJob.php b/app/Jobs/Schedule/RunTaskJob.php index e9d51e185..8977d3c17 100644 --- a/app/Jobs/Schedule/RunTaskJob.php +++ b/app/Jobs/Schedule/RunTaskJob.php @@ -35,7 +35,7 @@ class RunTaskJob extends Job implements ShouldQueue public function handle( InitiateBackupService $backupService, DaemonPowerRepository $powerRepository - ) { + ): void { // Do not process a task that is not set to active, unless it's been manually triggered. if (!$this->task->schedule->is_active && !$this->manualRun) { $this->markTaskNotQueued(); diff --git a/app/Models/ActivityLogSubject.php b/app/Models/ActivityLogSubject.php index 3786a88d1..037d344f0 100644 --- a/app/Models/ActivityLogSubject.php +++ b/app/Models/ActivityLogSubject.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\Pivot; use Illuminate\Database\Eloquent\SoftDeletes; @@ -30,7 +31,7 @@ class ActivityLogSubject extends Pivot protected $guarded = ['id']; - public function activityLog() + public function activityLog(): BelongsTo { return $this->belongsTo(ActivityLog::class); } diff --git a/app/Providers/ActivityLogServiceProvider.php b/app/Providers/ActivityLogServiceProvider.php index c490fc582..f783a3fd0 100644 --- a/app/Providers/ActivityLogServiceProvider.php +++ b/app/Providers/ActivityLogServiceProvider.php @@ -12,7 +12,7 @@ class ActivityLogServiceProvider extends ServiceProvider * Registers the necessary activity logger singletons scoped to the individual * request instances. */ - public function register() + public function register(): void { $this->app->scoped(ActivityLogBatchService::class); $this->app->scoped(ActivityLogTargetableService::class); diff --git a/database/Factories/ServerFactory.php b/database/Factories/ServerFactory.php index 8a594b86c..1f55c8c45 100644 --- a/database/Factories/ServerFactory.php +++ b/database/Factories/ServerFactory.php @@ -22,7 +22,7 @@ class ServerFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { return [ 'uuid' => Uuid::uuid4()->toString(), diff --git a/database/Factories/UserSSHKeyFactory.php b/database/Factories/UserSSHKeyFactory.php index ab20b251d..e60bd821c 100644 --- a/database/Factories/UserSSHKeyFactory.php +++ b/database/Factories/UserSSHKeyFactory.php @@ -24,7 +24,7 @@ class UserSSHKeyFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { $key = PublicKeyLoader::loadPublicKey(static::$keys['ed25519']); diff --git a/database/migrations/2016_01_23_195641_add_allocations_table.php b/database/migrations/2016_01_23_195641_add_allocations_table.php index 4df174274..2ff176b02 100644 --- a/database/migrations/2016_01_23_195641_add_allocations_table.php +++ b/database/migrations/2016_01_23_195641_add_allocations_table.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('allocations', function (Blueprint $table) { $table->increments('id'); @@ -23,7 +23,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('allocations'); } diff --git a/database/migrations/2016_01_23_195851_add_api_keys.php b/database/migrations/2016_01_23_195851_add_api_keys.php index c200a97d0..6dfe066f6 100644 --- a/database/migrations/2016_01_23_195851_add_api_keys.php +++ b/database/migrations/2016_01_23_195851_add_api_keys.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('api_keys', function (Blueprint $table) { $table->increments('id'); @@ -22,7 +22,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('api_keys'); } diff --git a/database/migrations/2016_01_23_200044_add_api_permissions.php b/database/migrations/2016_01_23_200044_add_api_permissions.php index aef1d6661..b850d797d 100644 --- a/database/migrations/2016_01_23_200044_add_api_permissions.php +++ b/database/migrations/2016_01_23_200044_add_api_permissions.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('api_permissions', function (Blueprint $table) { $table->increments('id'); @@ -20,7 +20,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('api_permissions'); } diff --git a/database/migrations/2016_01_23_200159_add_downloads.php b/database/migrations/2016_01_23_200159_add_downloads.php index 7b10ccf47..493e71ef9 100644 --- a/database/migrations/2016_01_23_200159_add_downloads.php +++ b/database/migrations/2016_01_23_200159_add_downloads.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('downloads', function (Blueprint $table) { $table->increments('id'); @@ -22,7 +22,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('downloads'); } diff --git a/database/migrations/2016_01_23_200421_create_failed_jobs_table.php b/database/migrations/2016_01_23_200421_create_failed_jobs_table.php index b93f203ad..55b79845d 100644 --- a/database/migrations/2016_01_23_200421_create_failed_jobs_table.php +++ b/database/migrations/2016_01_23_200421_create_failed_jobs_table.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('failed_jobs', function (Blueprint $table) { $table->increments('id'); @@ -22,7 +22,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('failed_jobs'); } diff --git a/database/migrations/2016_01_23_200440_create_jobs_table.php b/database/migrations/2016_01_23_200440_create_jobs_table.php index 9e235a8ba..9fe36bb1e 100644 --- a/database/migrations/2016_01_23_200440_create_jobs_table.php +++ b/database/migrations/2016_01_23_200440_create_jobs_table.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('jobs', function (Blueprint $table) { $table->bigIncrements('id'); @@ -26,7 +26,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('jobs'); } diff --git a/database/migrations/2016_01_23_200528_add_locations.php b/database/migrations/2016_01_23_200528_add_locations.php index f5977f8e5..6cf0c9bbe 100644 --- a/database/migrations/2016_01_23_200528_add_locations.php +++ b/database/migrations/2016_01_23_200528_add_locations.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('locations', function (Blueprint $table) { $table->increments('id'); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('locations'); } diff --git a/database/migrations/2016_01_23_200648_add_nodes.php b/database/migrations/2016_01_23_200648_add_nodes.php index 0901b2e05..2344b8f83 100644 --- a/database/migrations/2016_01_23_200648_add_nodes.php +++ b/database/migrations/2016_01_23_200648_add_nodes.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('nodes', function (Blueprint $table) { $table->increments('id'); @@ -32,7 +32,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('nodes'); } diff --git a/database/migrations/2016_01_23_201433_add_password_resets.php b/database/migrations/2016_01_23_201433_add_password_resets.php index 372e79b09..8a0ac8d7a 100644 --- a/database/migrations/2016_01_23_201433_add_password_resets.php +++ b/database/migrations/2016_01_23_201433_add_password_resets.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('password_resets', function (Blueprint $table) { $table->string('email')->index(); @@ -20,7 +20,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('password_resets'); } diff --git a/database/migrations/2016_01_23_201531_add_permissions.php b/database/migrations/2016_01_23_201531_add_permissions.php index a5eb800ad..81c20d2f8 100644 --- a/database/migrations/2016_01_23_201531_add_permissions.php +++ b/database/migrations/2016_01_23_201531_add_permissions.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('permissions', function (Blueprint $table) { $table->increments('id'); @@ -22,7 +22,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('permissions'); } diff --git a/database/migrations/2016_01_23_201649_add_server_variables.php b/database/migrations/2016_01_23_201649_add_server_variables.php index a1115da02..f56425302 100644 --- a/database/migrations/2016_01_23_201649_add_server_variables.php +++ b/database/migrations/2016_01_23_201649_add_server_variables.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('server_variables', function (Blueprint $table) { $table->increments('id'); @@ -22,7 +22,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('server_variables'); } diff --git a/database/migrations/2016_01_23_201748_add_servers.php b/database/migrations/2016_01_23_201748_add_servers.php index 14ef415fc..580339d17 100644 --- a/database/migrations/2016_01_23_201748_add_servers.php +++ b/database/migrations/2016_01_23_201748_add_servers.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('servers', function (Blueprint $table) { $table->increments('id'); @@ -39,7 +39,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('servers'); } diff --git a/database/migrations/2016_01_23_202544_add_service_options.php b/database/migrations/2016_01_23_202544_add_service_options.php index 12205b131..72fd8dc85 100644 --- a/database/migrations/2016_01_23_202544_add_service_options.php +++ b/database/migrations/2016_01_23_202544_add_service_options.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('service_options', function (Blueprint $table) { $table->increments('id'); @@ -24,7 +24,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('service_options'); } diff --git a/database/migrations/2016_01_23_202731_add_service_varibles.php b/database/migrations/2016_01_23_202731_add_service_varibles.php index 54bd4e02e..b324862f1 100644 --- a/database/migrations/2016_01_23_202731_add_service_varibles.php +++ b/database/migrations/2016_01_23_202731_add_service_varibles.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('service_variables', function (Blueprint $table) { $table->increments('id'); @@ -28,7 +28,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('service_variables'); } diff --git a/database/migrations/2016_01_23_202943_add_services.php b/database/migrations/2016_01_23_202943_add_services.php index 95bb8a272..966c745d8 100644 --- a/database/migrations/2016_01_23_202943_add_services.php +++ b/database/migrations/2016_01_23_202943_add_services.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('services', function (Blueprint $table) { $table->increments('id'); @@ -24,7 +24,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('services'); } diff --git a/database/migrations/2016_01_23_203119_create_settings_table.php b/database/migrations/2016_01_23_203119_create_settings_table.php index 0564fb157..b5cb6e003 100644 --- a/database/migrations/2016_01_23_203119_create_settings_table.php +++ b/database/migrations/2016_01_23_203119_create_settings_table.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('settings', function (Blueprint $table) { $table->string('key')->unique(); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('settings'); } diff --git a/database/migrations/2016_01_23_203150_add_subusers.php b/database/migrations/2016_01_23_203150_add_subusers.php index d524edf41..44cb8dfc3 100644 --- a/database/migrations/2016_01_23_203150_add_subusers.php +++ b/database/migrations/2016_01_23_203150_add_subusers.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('subusers', function (Blueprint $table) { $table->increments('id'); @@ -22,7 +22,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('subusers'); } diff --git a/database/migrations/2016_01_23_203159_add_users.php b/database/migrations/2016_01_23_203159_add_users.php index 921ea6228..7c3e8afa1 100644 --- a/database/migrations/2016_01_23_203159_add_users.php +++ b/database/migrations/2016_01_23_203159_add_users.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('users', function (Blueprint $table) { $table->increments('id'); @@ -27,7 +27,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('users'); } diff --git a/database/migrations/2016_01_23_203947_create_sessions_table.php b/database/migrations/2016_01_23_203947_create_sessions_table.php index a8a561ca6..1017a858e 100644 --- a/database/migrations/2016_01_23_203947_create_sessions_table.php +++ b/database/migrations/2016_01_23_203947_create_sessions_table.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('sessions', function (Blueprint $table) { $table->string('id')->unique(); @@ -23,7 +23,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::drop('sessions'); } diff --git a/database/migrations/2016_01_25_234418_rename_permissions_column.php b/database/migrations/2016_01_25_234418_rename_permissions_column.php index 93ee75fcf..49e78c2e9 100644 --- a/database/migrations/2016_01_25_234418_rename_permissions_column.php +++ b/database/migrations/2016_01_25_234418_rename_permissions_column.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('permissions', function (Blueprint $table) { $table->renameColumn('permissions', 'permission'); @@ -18,7 +18,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('permissions', function (Blueprint $table) { }); diff --git a/database/migrations/2016_02_07_172148_add_databases_tables.php b/database/migrations/2016_02_07_172148_add_databases_tables.php index d770c81b5..dbcb53509 100644 --- a/database/migrations/2016_02_07_172148_add_databases_tables.php +++ b/database/migrations/2016_02_07_172148_add_databases_tables.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('databases', function (Blueprint $table) { $table->increments('id'); @@ -25,7 +25,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::drop('databases'); } diff --git a/database/migrations/2016_02_07_181319_add_database_servers_table.php b/database/migrations/2016_02_07_181319_add_database_servers_table.php index 2681f5a05..8c30a426b 100644 --- a/database/migrations/2016_02_07_181319_add_database_servers_table.php +++ b/database/migrations/2016_02_07_181319_add_database_servers_table.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('database_servers', function (Blueprint $table) { $table->increments('id'); @@ -26,7 +26,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::drop('database_servers'); } diff --git a/database/migrations/2016_02_13_154306_add_service_option_default_startup.php b/database/migrations/2016_02_13_154306_add_service_option_default_startup.php index b5ae8c278..840b32fb0 100644 --- a/database/migrations/2016_02_13_154306_add_service_option_default_startup.php +++ b/database/migrations/2016_02_13_154306_add_service_option_default_startup.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_options', function (Blueprint $table) { $table->text('executable')->after('docker_image')->nullable()->default(null); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropColumn('executable'); diff --git a/database/migrations/2016_02_20_155318_add_unique_service_field.php b/database/migrations/2016_02_20_155318_add_unique_service_field.php index 8733b4691..2fec30259 100644 --- a/database/migrations/2016_02_20_155318_add_unique_service_field.php +++ b/database/migrations/2016_02_20_155318_add_unique_service_field.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('services', function (Blueprint $table) { $table->string('file')->unique()->change(); @@ -18,7 +18,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('services', function (Blueprint $table) { $table->dropUnique('services_file_unique'); diff --git a/database/migrations/2016_02_27_163411_add_tasks_table.php b/database/migrations/2016_02_27_163411_add_tasks_table.php index 472249e2d..699afedbe 100644 --- a/database/migrations/2016_02_27_163411_add_tasks_table.php +++ b/database/migrations/2016_02_27_163411_add_tasks_table.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('tasks', function (Blueprint $table) { $table->increments('id'); @@ -32,7 +32,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::drop('tasks'); } diff --git a/database/migrations/2016_02_27_163447_add_tasks_log_table.php b/database/migrations/2016_02_27_163447_add_tasks_log_table.php index c0792de40..987f10642 100644 --- a/database/migrations/2016_02_27_163447_add_tasks_log_table.php +++ b/database/migrations/2016_02_27_163447_add_tasks_log_table.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('tasks_log', function (Blueprint $table) { $table->increments('id'); @@ -23,7 +23,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::drop('tasks_log'); } diff --git a/database/migrations/2016_03_18_155649_add_nullable_field_lastrun.php b/database/migrations/2016_03_18_155649_add_nullable_field_lastrun.php index 946d79c4b..3eaf06a87 100644 --- a/database/migrations/2016_03_18_155649_add_nullable_field_lastrun.php +++ b/database/migrations/2016_03_18_155649_add_nullable_field_lastrun.php @@ -7,7 +7,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { $table = DB::getQueryGrammar()->wrapTable('tasks'); DB::statement('ALTER TABLE ' . $table . ' CHANGE `last_run` `last_run` TIMESTAMP NULL;'); @@ -16,7 +16,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { $table = DB::getQueryGrammar()->wrapTable('tasks'); DB::statement('ALTER TABLE ' . $table . ' CHANGE `last_run` `last_run` TIMESTAMP;'); diff --git a/database/migrations/2016_08_30_212718_add_ip_alias.php b/database/migrations/2016_08_30_212718_add_ip_alias.php index c65bc88bf..1618b8955 100644 --- a/database/migrations/2016_08_30_212718_add_ip_alias.php +++ b/database/migrations/2016_08_30_212718_add_ip_alias.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('allocations', function (Blueprint $table) { $table->text('ip_alias')->nullable()->after('ip'); @@ -29,7 +29,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('allocations', function (Blueprint $table) { $table->dropColumn('ip_alias'); diff --git a/database/migrations/2016_08_30_213301_modify_ip_storage_method.php b/database/migrations/2016_08_30_213301_modify_ip_storage_method.php index f8b1ee2cc..774697eb5 100644 --- a/database/migrations/2016_08_30_213301_modify_ip_storage_method.php +++ b/database/migrations/2016_08_30_213301_modify_ip_storage_method.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->mediumInteger('allocation')->unsigned()->after('oom_disabled'); @@ -47,7 +47,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->text('ip')->after('allocation'); diff --git a/database/migrations/2016_09_01_193520_add_suspension_for_servers.php b/database/migrations/2016_09_01_193520_add_suspension_for_servers.php index 53fddbb86..62511e73b 100644 --- a/database/migrations/2016_09_01_193520_add_suspension_for_servers.php +++ b/database/migrations/2016_09_01_193520_add_suspension_for_servers.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->tinyInteger('suspended')->unsigned()->default(0)->after('active'); @@ -18,7 +18,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('suspended'); diff --git a/database/migrations/2016_09_01_211924_remove_active_column.php b/database/migrations/2016_09_01_211924_remove_active_column.php index 0f80902fd..3c640f288 100644 --- a/database/migrations/2016_09_01_211924_remove_active_column.php +++ b/database/migrations/2016_09_01_211924_remove_active_column.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('active'); @@ -18,7 +18,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->tinyInteger('active')->after('name')->unsigned()->default(0); diff --git a/database/migrations/2016_09_02_190647_add_sftp_password_storage.php b/database/migrations/2016_09_02_190647_add_sftp_password_storage.php index 0a2913e15..859a06984 100644 --- a/database/migrations/2016_09_02_190647_add_sftp_password_storage.php +++ b/database/migrations/2016_09_02_190647_add_sftp_password_storage.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->text('sftp_password')->after('username')->nullable(); @@ -18,7 +18,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('sftp_password'); diff --git a/database/migrations/2016_09_04_171338_update_jobs_tables.php b/database/migrations/2016_09_04_171338_update_jobs_tables.php index a3fffad56..514167bea 100644 --- a/database/migrations/2016_09_04_171338_update_jobs_tables.php +++ b/database/migrations/2016_09_04_171338_update_jobs_tables.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('jobs', function (Blueprint $table) { $table->dropIndex('jobs_queue_reserved_reserved_at_index'); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('jobs', function (Blueprint $table) { $table->dropIndex('jobs_queue_reserved_at_index'); diff --git a/database/migrations/2016_09_04_172028_update_failed_jobs_table.php b/database/migrations/2016_09_04_172028_update_failed_jobs_table.php index 7b333b67d..e0a6b889c 100644 --- a/database/migrations/2016_09_04_172028_update_failed_jobs_table.php +++ b/database/migrations/2016_09_04_172028_update_failed_jobs_table.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('failed_jobs', function (Blueprint $table) { $table->text('exception'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('failed_jobs', function (Blueprint $table) { $table->dropColumn('exception'); diff --git a/database/migrations/2016_09_04_182835_create_notifications_table.php b/database/migrations/2016_09_04_182835_create_notifications_table.php index 1a711e722..788e37be0 100644 --- a/database/migrations/2016_09_04_182835_create_notifications_table.php +++ b/database/migrations/2016_09_04_182835_create_notifications_table.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('notifications', function (Blueprint $table) { $table->string('id')->primary(); @@ -23,7 +23,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::drop('notifications'); } diff --git a/database/migrations/2016_09_07_163017_add_unique_identifier.php b/database/migrations/2016_09_07_163017_add_unique_identifier.php index 188cd90df..ad186c385 100644 --- a/database/migrations/2016_09_07_163017_add_unique_identifier.php +++ b/database/migrations/2016_09_07_163017_add_unique_identifier.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('services', function (Blueprint $table) { $table->char('author', 36)->after('id'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('services', function (Blueprint $table) { $table->dropColumn('author'); diff --git a/database/migrations/2016_09_14_145945_allow_longer_regex_field.php b/database/migrations/2016_09_14_145945_allow_longer_regex_field.php index a608a4397..f4c1ae879 100644 --- a/database/migrations/2016_09_14_145945_allow_longer_regex_field.php +++ b/database/migrations/2016_09_14_145945_allow_longer_regex_field.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_variables', function (Blueprint $table) { $table->text('regex')->change(); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_variables', function (Blueprint $table) { $table->string('regex')->change(); diff --git a/database/migrations/2016_09_17_194246_add_docker_image_column.php b/database/migrations/2016_09_17_194246_add_docker_image_column.php index 5da98056d..f71993c41 100644 --- a/database/migrations/2016_09_17_194246_add_docker_image_column.php +++ b/database/migrations/2016_09_17_194246_add_docker_image_column.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->string('image')->after('daemonSecret'); @@ -32,7 +32,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('image'); diff --git a/database/migrations/2016_09_21_165554_update_servers_column_name.php b/database/migrations/2016_09_21_165554_update_servers_column_name.php index edac43f36..1ef86ff03 100644 --- a/database/migrations/2016_09_21_165554_update_servers_column_name.php +++ b/database/migrations/2016_09_21_165554_update_servers_column_name.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('databases', function (Blueprint $table) { $table->renameColumn('server', 'server_id'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('databases', function (Blueprint $table) { $table->renameColumn('server_id', 'server'); diff --git a/database/migrations/2016_09_29_213518_rename_double_insurgency.php b/database/migrations/2016_09_29_213518_rename_double_insurgency.php index 693a699d7..e48c99aed 100644 --- a/database/migrations/2016_09_29_213518_rename_double_insurgency.php +++ b/database/migrations/2016_09_29_213518_rename_double_insurgency.php @@ -7,7 +7,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::transaction(function () { $model = DB::table('service_options')->where('parent_service', 2)->where('id', 3)->where('name', 'Insurgency')->first(); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { } }; diff --git a/database/migrations/2016_10_07_152117_build_api_log_table.php b/database/migrations/2016_10_07_152117_build_api_log_table.php index 52e952328..0fa86e4ed 100644 --- a/database/migrations/2016_10_07_152117_build_api_log_table.php +++ b/database/migrations/2016_10_07_152117_build_api_log_table.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('api_logs', function (Blueprint $table) { $table->increments('id'); @@ -28,7 +28,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::drop('api_logs'); } diff --git a/database/migrations/2016_10_14_164802_update_api_keys.php b/database/migrations/2016_10_14_164802_update_api_keys.php index 2fff53eab..0d4032f9b 100644 --- a/database/migrations/2016_10_14_164802_update_api_keys.php +++ b/database/migrations/2016_10_14_164802_update_api_keys.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('api_keys', function (Blueprint $table) { $table->unsignedInteger('user')->after('id'); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('api_keys', function (Blueprint $table) { $table->dropColumn('user'); diff --git a/database/migrations/2016_10_23_181719_update_misnamed_bungee.php b/database/migrations/2016_10_23_181719_update_misnamed_bungee.php index c5843ac19..ff10f9c4b 100644 --- a/database/migrations/2016_10_23_181719_update_misnamed_bungee.php +++ b/database/migrations/2016_10_23_181719_update_misnamed_bungee.php @@ -7,7 +7,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::table('service_variables')->select('env_variable')->where('env_variable', 'BUNGE_VERSION')->update([ 'env_variable' => 'BUNGEE_VERSION', @@ -17,7 +17,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { } }; diff --git a/database/migrations/2016_10_23_193810_add_foreign_keys_servers.php b/database/migrations/2016_10_23_193810_add_foreign_keys_servers.php index 1b557d8c5..7301caa75 100644 --- a/database/migrations/2016_10_23_193810_add_foreign_keys_servers.php +++ b/database/migrations/2016_10_23_193810_add_foreign_keys_servers.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::statement('ALTER TABLE servers MODIFY COLUMN node INT(10) UNSIGNED NOT NULL, @@ -32,7 +32,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropForeign('servers_node_foreign'); diff --git a/database/migrations/2016_10_23_201624_add_foreign_allocations.php b/database/migrations/2016_10_23_201624_add_foreign_allocations.php index db89bd0d9..76a6a141f 100644 --- a/database/migrations/2016_10_23_201624_add_foreign_allocations.php +++ b/database/migrations/2016_10_23_201624_add_foreign_allocations.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::statement('ALTER TABLE allocations MODIFY COLUMN assigned_to INT(10) UNSIGNED NULL, @@ -25,7 +25,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('allocations', function (Blueprint $table) { $table->dropForeign('allocations_assigned_to_foreign'); diff --git a/database/migrations/2016_10_23_202222_add_foreign_api_keys.php b/database/migrations/2016_10_23_202222_add_foreign_api_keys.php index e4c5bfeae..5a7c8d565 100644 --- a/database/migrations/2016_10_23_202222_add_foreign_api_keys.php +++ b/database/migrations/2016_10_23_202222_add_foreign_api_keys.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('api_keys', function (Blueprint $table) { $table->foreign('user')->references('id')->on('users'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('api_keys', function (Blueprint $table) { $table->dropForeign('api_keys_user_foreign'); diff --git a/database/migrations/2016_10_23_202703_add_foreign_api_permissions.php b/database/migrations/2016_10_23_202703_add_foreign_api_permissions.php index d71a58587..8b3322a60 100644 --- a/database/migrations/2016_10_23_202703_add_foreign_api_permissions.php +++ b/database/migrations/2016_10_23_202703_add_foreign_api_permissions.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::statement('ALTER TABLE api_permissions MODIFY key_id INT(10) UNSIGNED NOT NULL'); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('api_permissions', function (Blueprint $table) { $table->dropForeign('api_permissions_key_id_foreign'); diff --git a/database/migrations/2016_10_23_202953_add_foreign_database_servers.php b/database/migrations/2016_10_23_202953_add_foreign_database_servers.php index a0c38c353..80259bf00 100644 --- a/database/migrations/2016_10_23_202953_add_foreign_database_servers.php +++ b/database/migrations/2016_10_23_202953_add_foreign_database_servers.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('database_servers', function (Blueprint $table) { $table->foreign('linked_node')->references('id')->on('nodes'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('database_servers', function (Blueprint $table) { $table->dropForeign('database_servers_linked_node_foreign'); diff --git a/database/migrations/2016_10_23_203105_add_foreign_databases.php b/database/migrations/2016_10_23_203105_add_foreign_databases.php index 47e9b547f..e3a92edb4 100644 --- a/database/migrations/2016_10_23_203105_add_foreign_databases.php +++ b/database/migrations/2016_10_23_203105_add_foreign_databases.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('databases', function (Blueprint $table) { $table->foreign('server_id')->references('id')->on('servers'); @@ -20,7 +20,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('databases', function (Blueprint $table) { $table->dropForeign('databases_server_id_foreign'); diff --git a/database/migrations/2016_10_23_203335_add_foreign_nodes.php b/database/migrations/2016_10_23_203335_add_foreign_nodes.php index 3f9ea486e..9d8d57249 100644 --- a/database/migrations/2016_10_23_203335_add_foreign_nodes.php +++ b/database/migrations/2016_10_23_203335_add_foreign_nodes.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::statement('ALTER TABLE nodes MODIFY location INT(10) UNSIGNED NOT NULL'); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('nodes', function (Blueprint $table) { $table->dropForeign('nodes_location_foreign'); diff --git a/database/migrations/2016_10_23_203522_add_foreign_permissions.php b/database/migrations/2016_10_23_203522_add_foreign_permissions.php index a99f59b73..8af4860b4 100644 --- a/database/migrations/2016_10_23_203522_add_foreign_permissions.php +++ b/database/migrations/2016_10_23_203522_add_foreign_permissions.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('permissions', function (Blueprint $table) { $table->foreign('user_id')->references('id')->on('users'); @@ -20,7 +20,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('permissions', function (Blueprint $table) { $table->dropForeign('permissions_user_id_foreign'); diff --git a/database/migrations/2016_10_23_203857_add_foreign_server_variables.php b/database/migrations/2016_10_23_203857_add_foreign_server_variables.php index ad50836f8..4c3c38258 100644 --- a/database/migrations/2016_10_23_203857_add_foreign_server_variables.php +++ b/database/migrations/2016_10_23_203857_add_foreign_server_variables.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::statement('ALTER TABLE server_variables MODIFY COLUMN server_id INT(10) UNSIGNED NULL, @@ -25,7 +25,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('server_variables', function (Blueprint $table) { $table->dropForeign(['server_id']); diff --git a/database/migrations/2016_10_23_204157_add_foreign_service_options.php b/database/migrations/2016_10_23_204157_add_foreign_service_options.php index 782873893..ad445dcfa 100644 --- a/database/migrations/2016_10_23_204157_add_foreign_service_options.php +++ b/database/migrations/2016_10_23_204157_add_foreign_service_options.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::statement('ALTER TABLE service_options MODIFY parent_service INT(10) UNSIGNED NOT NULL'); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropForeign('service_options_parent_service_foreign'); diff --git a/database/migrations/2016_10_23_204321_add_foreign_service_variables.php b/database/migrations/2016_10_23_204321_add_foreign_service_variables.php index 0644dcdbf..6c45c53e0 100644 --- a/database/migrations/2016_10_23_204321_add_foreign_service_variables.php +++ b/database/migrations/2016_10_23_204321_add_foreign_service_variables.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::statement('ALTER TABLE service_variables MODIFY option_id INT(10) UNSIGNED NOT NULL'); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_variables', function (Blueprint $table) { $table->dropForeign('service_variables_option_id_foreign'); diff --git a/database/migrations/2016_10_23_204454_add_foreign_subusers.php b/database/migrations/2016_10_23_204454_add_foreign_subusers.php index cf2424f34..6b509932b 100644 --- a/database/migrations/2016_10_23_204454_add_foreign_subusers.php +++ b/database/migrations/2016_10_23_204454_add_foreign_subusers.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('subusers', function (Blueprint $table) { $table->foreign('user_id')->references('id')->on('users'); @@ -20,7 +20,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('subusers', function (Blueprint $table) { $table->dropForeign('subusers_user_id_foreign'); diff --git a/database/migrations/2016_10_23_204610_add_foreign_tasks.php b/database/migrations/2016_10_23_204610_add_foreign_tasks.php index 1c05b1df9..8ec7ce911 100644 --- a/database/migrations/2016_10_23_204610_add_foreign_tasks.php +++ b/database/migrations/2016_10_23_204610_add_foreign_tasks.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('tasks', function (Blueprint $table) { $table->foreign('server')->references('id')->on('servers'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('tasks', function (Blueprint $table) { $table->dropForeign(['server']); diff --git a/database/migrations/2016_11_11_220649_add_pack_support.php b/database/migrations/2016_11_11_220649_add_pack_support.php index f2c29ee24..07ed33861 100644 --- a/database/migrations/2016_11_11_220649_add_pack_support.php +++ b/database/migrations/2016_11_11_220649_add_pack_support.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('service_packs', function (Blueprint $table) { $table->increments('id'); @@ -29,7 +29,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::drop('service_packs'); } diff --git a/database/migrations/2016_11_11_231731_set_service_name_unique.php b/database/migrations/2016_11_11_231731_set_service_name_unique.php index a4ff73483..381cf3f7c 100644 --- a/database/migrations/2016_11_11_231731_set_service_name_unique.php +++ b/database/migrations/2016_11_11_231731_set_service_name_unique.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('services', function (Blueprint $table) { $table->unique('name'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('services', function (Blueprint $table) { $table->dropUnique('services_name_unique'); diff --git a/database/migrations/2016_11_27_142519_add_pack_column.php b/database/migrations/2016_11_27_142519_add_pack_column.php index bcf01da5c..e07046b21 100644 --- a/database/migrations/2016_11_27_142519_add_pack_column.php +++ b/database/migrations/2016_11_27_142519_add_pack_column.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->unsignedInteger('pack')->nullable()->after('option'); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropForeign(['pack']); diff --git a/database/migrations/2016_12_01_173018_add_configurable_upload_limit.php b/database/migrations/2016_12_01_173018_add_configurable_upload_limit.php index ac0c01a00..108d92d9f 100644 --- a/database/migrations/2016_12_01_173018_add_configurable_upload_limit.php +++ b/database/migrations/2016_12_01_173018_add_configurable_upload_limit.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('nodes', function (Blueprint $table) { $table->unsignedInteger('upload_size')->after('disk_overallocate')->default(100); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('nodes', function (Blueprint $table) { $table->dropColumn('upload_size'); diff --git a/database/migrations/2016_12_02_185206_correct_service_variables.php b/database/migrations/2016_12_02_185206_correct_service_variables.php index a6d24025a..315cea6eb 100644 --- a/database/migrations/2016_12_02_185206_correct_service_variables.php +++ b/database/migrations/2016_12_02_185206_correct_service_variables.php @@ -7,7 +7,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::transaction(function () { // Modify Default Spigot Startup Line @@ -66,7 +66,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { // do nothing } diff --git a/database/migrations/2017_01_07_154228_create_node_configuration_tokens_table.php b/database/migrations/2017_01_07_154228_create_node_configuration_tokens_table.php index 762aedd9e..8be53ea8a 100644 --- a/database/migrations/2017_01_07_154228_create_node_configuration_tokens_table.php +++ b/database/migrations/2017_01_07_154228_create_node_configuration_tokens_table.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('node_configuration_tokens', function (Blueprint $table) { $table->increments('id'); @@ -24,7 +24,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('node_configuration_tokens'); } diff --git a/database/migrations/2017_01_12_135449_add_more_user_data.php b/database/migrations/2017_01_12_135449_add_more_user_data.php index af8862244..aa8609505 100644 --- a/database/migrations/2017_01_12_135449_add_more_user_data.php +++ b/database/migrations/2017_01_12_135449_add_more_user_data.php @@ -10,7 +10,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('name_first')->after('email')->nullable(); @@ -34,7 +34,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('name_first'); diff --git a/database/migrations/2017_02_02_175548_UpdateColumnNames.php b/database/migrations/2017_02_02_175548_UpdateColumnNames.php index 5d7d2c4d7..0c8b34149 100644 --- a/database/migrations/2017_02_02_175548_UpdateColumnNames.php +++ b/database/migrations/2017_02_02_175548_UpdateColumnNames.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->dropForeign('servers_node_foreign'); @@ -47,7 +47,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropForeign(['node_id']); diff --git a/database/migrations/2017_02_03_140948_UpdateNodesTable.php b/database/migrations/2017_02_03_140948_UpdateNodesTable.php index e443573e0..a46be44a2 100644 --- a/database/migrations/2017_02_03_140948_UpdateNodesTable.php +++ b/database/migrations/2017_02_03_140948_UpdateNodesTable.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('nodes', function (Blueprint $table) { $table->dropForeign('nodes_location_foreign'); @@ -23,7 +23,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('nodes', function (Blueprint $table) { $table->dropForeign('nodes_location_id_foreign'); diff --git a/database/migrations/2017_02_03_155554_RenameColumns.php b/database/migrations/2017_02_03_155554_RenameColumns.php index 764905a6d..250689a71 100644 --- a/database/migrations/2017_02_03_155554_RenameColumns.php +++ b/database/migrations/2017_02_03_155554_RenameColumns.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('allocations', function (Blueprint $table) { $table->dropForeign('allocations_node_foreign'); @@ -27,7 +27,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('allocations', function (Blueprint $table) { $table->dropForeign('allocations_node_id_foreign'); diff --git a/database/migrations/2017_02_05_164123_AdjustColumnNames.php b/database/migrations/2017_02_05_164123_AdjustColumnNames.php index 497b8387f..fc6ecaaa8 100644 --- a/database/migrations/2017_02_05_164123_AdjustColumnNames.php +++ b/database/migrations/2017_02_05_164123_AdjustColumnNames.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropForeign('service_options_parent_service_foreign'); @@ -23,7 +23,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropForeign('service_options_service_id_foreign'); diff --git a/database/migrations/2017_02_05_164516_AdjustColumnNamesForServicePacks.php b/database/migrations/2017_02_05_164516_AdjustColumnNamesForServicePacks.php index b3042b350..a1ba015b4 100644 --- a/database/migrations/2017_02_05_164516_AdjustColumnNamesForServicePacks.php +++ b/database/migrations/2017_02_05_164516_AdjustColumnNamesForServicePacks.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_packs', function (Blueprint $table) { $table->dropForeign('service_packs_option_foreign'); @@ -23,7 +23,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_packs', function (Blueprint $table) { $table->dropForeign('service_packs_option_id_foreign'); diff --git a/database/migrations/2017_02_09_174834_SetupPermissionsPivotTable.php b/database/migrations/2017_02_09_174834_SetupPermissionsPivotTable.php index ec27be0a1..2a51fb015 100644 --- a/database/migrations/2017_02_09_174834_SetupPermissionsPivotTable.php +++ b/database/migrations/2017_02_09_174834_SetupPermissionsPivotTable.php @@ -11,7 +11,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('permissions', function (Blueprint $table) { $table->unsignedInteger('subuser_id')->after('id'); @@ -42,7 +42,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('permissions', function (Blueprint $table) { $table->unsignedInteger('server_id')->after('subuser_id'); diff --git a/database/migrations/2017_02_10_171858_UpdateAPIKeyColumnNames.php b/database/migrations/2017_02_10_171858_UpdateAPIKeyColumnNames.php index 720d2a0a5..7411fd183 100644 --- a/database/migrations/2017_02_10_171858_UpdateAPIKeyColumnNames.php +++ b/database/migrations/2017_02_10_171858_UpdateAPIKeyColumnNames.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('api_keys', function (Blueprint $table) { $table->dropForeign('api_keys_user_foreign')->dropIndex('api_keys_user_foreign'); @@ -22,7 +22,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('api_keys', function (Blueprint $table) { $table->dropForeign('api_keys_user_id_foreign')->dropIndex('api_keys_user_id_foreign'); diff --git a/database/migrations/2017_03_03_224254_UpdateNodeConfigTokensColumns.php b/database/migrations/2017_03_03_224254_UpdateNodeConfigTokensColumns.php index 4306038ee..e40823792 100644 --- a/database/migrations/2017_03_03_224254_UpdateNodeConfigTokensColumns.php +++ b/database/migrations/2017_03_03_224254_UpdateNodeConfigTokensColumns.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('node_configuration_tokens', function (Blueprint $table) { $table->dropForeign(['node']); @@ -23,7 +23,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('node_configuration_tokens', function (Blueprint $table) { $table->dropForeign(['node_id']); diff --git a/database/migrations/2017_03_05_212803_DeleteServiceExecutableOption.php b/database/migrations/2017_03_05_212803_DeleteServiceExecutableOption.php index 80887dd47..8846768d4 100644 --- a/database/migrations/2017_03_05_212803_DeleteServiceExecutableOption.php +++ b/database/migrations/2017_03_05_212803_DeleteServiceExecutableOption.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('services', function (Blueprint $table) { $table->renameColumn('file', 'folder'); @@ -22,7 +22,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('services', function (Blueprint $table) { $table->string('executable')->after('folder'); diff --git a/database/migrations/2017_03_10_162934_AddNewServiceOptionsColumns.php b/database/migrations/2017_03_10_162934_AddNewServiceOptionsColumns.php index a485f841d..9435dac7d 100644 --- a/database/migrations/2017_03_10_162934_AddNewServiceOptionsColumns.php +++ b/database/migrations/2017_03_10_162934_AddNewServiceOptionsColumns.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropColumn('executable'); @@ -27,7 +27,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropForeign(['config_from']); diff --git a/database/migrations/2017_03_10_173607_MigrateToNewServiceSystem.php b/database/migrations/2017_03_10_173607_MigrateToNewServiceSystem.php index 02fc8d4b3..db08ab83d 100644 --- a/database/migrations/2017_03_10_173607_MigrateToNewServiceSystem.php +++ b/database/migrations/2017_03_10_173607_MigrateToNewServiceSystem.php @@ -7,7 +7,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::transaction(function () { $service = DB::table('services')->where('author', config('panel.service.core'))->where('folder', 'srcds')->first(); @@ -32,7 +32,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { // Not doing reversals right now... } diff --git a/database/migrations/2017_03_11_215455_ChangeServiceVariablesValidationRules.php b/database/migrations/2017_03_11_215455_ChangeServiceVariablesValidationRules.php index d964f063a..b96b2ba24 100644 --- a/database/migrations/2017_03_11_215455_ChangeServiceVariablesValidationRules.php +++ b/database/migrations/2017_03_11_215455_ChangeServiceVariablesValidationRules.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_variables', function (Blueprint $table) { $table->renameColumn('regex', 'rules'); @@ -30,7 +30,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_variables', function (Blueprint $table) { $table->renameColumn('rules', 'regex'); diff --git a/database/migrations/2017_03_12_150648_MoveFunctionsFromFileToDatabase.php b/database/migrations/2017_03_12_150648_MoveFunctionsFromFileToDatabase.php index 7c566a02f..bf44de9ad 100644 --- a/database/migrations/2017_03_12_150648_MoveFunctionsFromFileToDatabase.php +++ b/database/migrations/2017_03_12_150648_MoveFunctionsFromFileToDatabase.php @@ -41,7 +41,7 @@ EOF; /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('services', function (Blueprint $table) { $table->text('index_file')->after('startup'); @@ -61,7 +61,7 @@ EOF; /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('services', function (Blueprint $table) { $table->dropColumn('index_file'); diff --git a/database/migrations/2017_03_14_175631_RenameServicePacksToSingluarPacks.php b/database/migrations/2017_03_14_175631_RenameServicePacksToSingluarPacks.php index b6a185c50..87496540d 100644 --- a/database/migrations/2017_03_14_175631_RenameServicePacksToSingluarPacks.php +++ b/database/migrations/2017_03_14_175631_RenameServicePacksToSingluarPacks.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_packs', function (Blueprint $table) { $table->dropForeign(['option_id']); @@ -25,7 +25,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('packs', function (Blueprint $table) { $table->dropForeign(['option_id']); diff --git a/database/migrations/2017_03_14_200326_AddLockedStatusToTable.php b/database/migrations/2017_03_14_200326_AddLockedStatusToTable.php index 60883fee0..89e72f1ea 100644 --- a/database/migrations/2017_03_14_200326_AddLockedStatusToTable.php +++ b/database/migrations/2017_03_14_200326_AddLockedStatusToTable.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('packs', function (Blueprint $table) { $table->boolean('locked')->default(false)->after('visible'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('packs', function (Blueprint $table) { $table->dropColumn('locked'); diff --git a/database/migrations/2017_03_16_181109_ReOrganizeDatabaseServersToDatabaseHost.php b/database/migrations/2017_03_16_181109_ReOrganizeDatabaseServersToDatabaseHost.php index 6872c9722..c0c271f7d 100644 --- a/database/migrations/2017_03_16_181109_ReOrganizeDatabaseServersToDatabaseHost.php +++ b/database/migrations/2017_03_16_181109_ReOrganizeDatabaseServersToDatabaseHost.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('database_servers', function (Blueprint $table) { $table->dropForeign(['linked_node']); @@ -27,7 +27,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('database_hosts', function (Blueprint $table) { $table->dropForeign(['node_id']); diff --git a/database/migrations/2017_03_16_181515_CleanupDatabasesDatabase.php b/database/migrations/2017_03_16_181515_CleanupDatabasesDatabase.php index ddc48ebc5..e53078a1b 100644 --- a/database/migrations/2017_03_16_181515_CleanupDatabasesDatabase.php +++ b/database/migrations/2017_03_16_181515_CleanupDatabasesDatabase.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('databases', function (Blueprint $table) { $table->dropForeign(['db_server']); @@ -23,7 +23,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('databases', function (Blueprint $table) { $table->dropForeign(['database_host_id']); diff --git a/database/migrations/2017_03_18_204953_AddForeignKeyToPacks.php b/database/migrations/2017_03_18_204953_AddForeignKeyToPacks.php index e10a493a2..5ed1a1184 100644 --- a/database/migrations/2017_03_18_204953_AddForeignKeyToPacks.php +++ b/database/migrations/2017_03_18_204953_AddForeignKeyToPacks.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->foreign('pack_id')->references('id')->on('packs'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropForeign(['pack_id']); diff --git a/database/migrations/2017_03_31_221948_AddServerDescriptionColumn.php b/database/migrations/2017_03_31_221948_AddServerDescriptionColumn.php index 6a69e58ab..cbda35f54 100644 --- a/database/migrations/2017_03_31_221948_AddServerDescriptionColumn.php +++ b/database/migrations/2017_03_31_221948_AddServerDescriptionColumn.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->text('description')->after('name'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('description'); diff --git a/database/migrations/2017_04_02_163232_DropDeletedAtColumnFromServers.php b/database/migrations/2017_04_02_163232_DropDeletedAtColumnFromServers.php index f35b66189..87e9a4d1d 100644 --- a/database/migrations/2017_04_02_163232_DropDeletedAtColumnFromServers.php +++ b/database/migrations/2017_04_02_163232_DropDeletedAtColumnFromServers.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('deleted_at'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->timestamp('deleted_at')->nullable(); diff --git a/database/migrations/2017_04_15_125021_UpgradeTaskSystem.php b/database/migrations/2017_04_15_125021_UpgradeTaskSystem.php index a4c624186..195a6559b 100644 --- a/database/migrations/2017_04_15_125021_UpgradeTaskSystem.php +++ b/database/migrations/2017_04_15_125021_UpgradeTaskSystem.php @@ -10,7 +10,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('tasks', function (Blueprint $table) { $table->dropForeign(['server']); @@ -33,7 +33,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('tasks', function (Blueprint $table) { // $table->dropForeign(['server_id']); diff --git a/database/migrations/2017_04_20_171943_AddScriptsToServiceOptions.php b/database/migrations/2017_04_20_171943_AddScriptsToServiceOptions.php index bfffe5d0c..662adcab3 100644 --- a/database/migrations/2017_04_20_171943_AddScriptsToServiceOptions.php +++ b/database/migrations/2017_04_20_171943_AddScriptsToServiceOptions.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_options', function (Blueprint $table) { $table->text('script_install')->after('startup')->nullable(); @@ -22,7 +22,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropColumn('script_install'); diff --git a/database/migrations/2017_04_21_151432_AddServiceScriptTrackingToServers.php b/database/migrations/2017_04_21_151432_AddServiceScriptTrackingToServers.php index eae2272fc..4018007aa 100644 --- a/database/migrations/2017_04_21_151432_AddServiceScriptTrackingToServers.php +++ b/database/migrations/2017_04_21_151432_AddServiceScriptTrackingToServers.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->boolean('skip_scripts')->default(false)->after('description'); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('skip_scripts'); diff --git a/database/migrations/2017_04_27_145300_AddCopyScriptFromColumn.php b/database/migrations/2017_04_27_145300_AddCopyScriptFromColumn.php index 556c34299..86933fcdd 100644 --- a/database/migrations/2017_04_27_145300_AddCopyScriptFromColumn.php +++ b/database/migrations/2017_04_27_145300_AddCopyScriptFromColumn.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_options', function (Blueprint $table) { $table->unsignedInteger('copy_script_from')->nullable()->after('script_container'); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropForeign(['copy_script_from']); diff --git a/database/migrations/2017_04_27_223629_AddAbilityToDefineConnectionOverSSLWithDaemonBehindProxy.php b/database/migrations/2017_04_27_223629_AddAbilityToDefineConnectionOverSSLWithDaemonBehindProxy.php index e546e2dd0..e2e383d8e 100644 --- a/database/migrations/2017_04_27_223629_AddAbilityToDefineConnectionOverSSLWithDaemonBehindProxy.php +++ b/database/migrations/2017_04_27_223629_AddAbilityToDefineConnectionOverSSLWithDaemonBehindProxy.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('nodes', function (Blueprint $table) { $table->boolean('behind_proxy')->after('scheme')->default(false); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('nodes', function (Blueprint $table) { $table->dropColumn('behind_proxy'); diff --git a/database/migrations/2017_05_01_141528_DeleteDownloadTable.php b/database/migrations/2017_05_01_141528_DeleteDownloadTable.php index 5e42c1ef7..685fb317d 100644 --- a/database/migrations/2017_05_01_141528_DeleteDownloadTable.php +++ b/database/migrations/2017_05_01_141528_DeleteDownloadTable.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::dropIfExists('downloads'); } @@ -17,7 +17,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::create('downloads', function (Blueprint $table) { $table->increments('id'); diff --git a/database/migrations/2017_05_01_141559_DeleteNodeConfigurationTable.php b/database/migrations/2017_05_01_141559_DeleteNodeConfigurationTable.php index 5ba2f1ee4..16d17b30f 100644 --- a/database/migrations/2017_05_01_141559_DeleteNodeConfigurationTable.php +++ b/database/migrations/2017_05_01_141559_DeleteNodeConfigurationTable.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::dropIfExists('node_configuration_tokens'); } @@ -17,7 +17,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::create('node_configuration_tokens', function (Blueprint $table) { $table->increments('id'); diff --git a/database/migrations/2017_06_10_152951_add_external_id_to_users.php b/database/migrations/2017_06_10_152951_add_external_id_to_users.php index 6ccca9cd3..2fd27d509 100644 --- a/database/migrations/2017_06_10_152951_add_external_id_to_users.php +++ b/database/migrations/2017_06_10_152951_add_external_id_to_users.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->unsignedInteger('external_id')->after('id')->nullable()->unique(); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('external_id'); diff --git a/database/migrations/2017_06_25_133923_ChangeForeignKeyToBeOnCascadeDelete.php b/database/migrations/2017_06_25_133923_ChangeForeignKeyToBeOnCascadeDelete.php index 3c9c5ea03..4ff8d2018 100644 --- a/database/migrations/2017_06_25_133923_ChangeForeignKeyToBeOnCascadeDelete.php +++ b/database/migrations/2017_06_25_133923_ChangeForeignKeyToBeOnCascadeDelete.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('api_permissions', function (Blueprint $table) { $table->dropForeign(['key_id']); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('api_permissions', function (Blueprint $table) { $table->dropForeign(['key_id']); diff --git a/database/migrations/2017_07_08_152806_ChangeUserPermissionsToDeleteOnUserDeletion.php b/database/migrations/2017_07_08_152806_ChangeUserPermissionsToDeleteOnUserDeletion.php index e2d5dd86b..a3dc806d5 100644 --- a/database/migrations/2017_07_08_152806_ChangeUserPermissionsToDeleteOnUserDeletion.php +++ b/database/migrations/2017_07_08_152806_ChangeUserPermissionsToDeleteOnUserDeletion.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('permissions', function (Blueprint $table) { $table->dropForeign(['subuser_id']); @@ -29,7 +29,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('subusers', function (Blueprint $table) { $table->dropForeign(['user_id']); diff --git a/database/migrations/2017_07_08_154416_SetAllocationToReferenceNullOnServerDelete.php b/database/migrations/2017_07_08_154416_SetAllocationToReferenceNullOnServerDelete.php index 920a13f5b..23f57020f 100644 --- a/database/migrations/2017_07_08_154416_SetAllocationToReferenceNullOnServerDelete.php +++ b/database/migrations/2017_07_08_154416_SetAllocationToReferenceNullOnServerDelete.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('allocations', function (Blueprint $table) { $table->dropForeign(['server_id']); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('allocations', function (Blueprint $table) { $table->dropForeign(['server_id']); diff --git a/database/migrations/2017_07_08_154650_CascadeDeletionWhenAServerOrVariableIsDeleted.php b/database/migrations/2017_07_08_154650_CascadeDeletionWhenAServerOrVariableIsDeleted.php index 34f946605..82f591b05 100644 --- a/database/migrations/2017_07_08_154650_CascadeDeletionWhenAServerOrVariableIsDeleted.php +++ b/database/migrations/2017_07_08_154650_CascadeDeletionWhenAServerOrVariableIsDeleted.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('server_variables', function (Blueprint $table) { $table->dropForeign(['server_id']); @@ -23,7 +23,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('server_variables', function (Blueprint $table) { $table->dropForeign(['server_id']); diff --git a/database/migrations/2017_07_24_194433_DeleteTaskWhenParentServerIsDeleted.php b/database/migrations/2017_07_24_194433_DeleteTaskWhenParentServerIsDeleted.php index 43115e056..dedc2879d 100644 --- a/database/migrations/2017_07_24_194433_DeleteTaskWhenParentServerIsDeleted.php +++ b/database/migrations/2017_07_24_194433_DeleteTaskWhenParentServerIsDeleted.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('tasks', function (Blueprint $table) { $table->dropForeign(['server_id']); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { } }; diff --git a/database/migrations/2017_08_05_115800_CascadeNullValuesForDatabaseHostWhenNodeIsDeleted.php b/database/migrations/2017_08_05_115800_CascadeNullValuesForDatabaseHostWhenNodeIsDeleted.php index f302ee5f2..a7822836d 100644 --- a/database/migrations/2017_08_05_115800_CascadeNullValuesForDatabaseHostWhenNodeIsDeleted.php +++ b/database/migrations/2017_08_05_115800_CascadeNullValuesForDatabaseHostWhenNodeIsDeleted.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('database_hosts', function (Blueprint $table) { $table->dropForeign(['node_id']); @@ -20,7 +20,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('database_hosts', function (Blueprint $table) { $table->dropForeign(['node_id']); diff --git a/database/migrations/2017_08_05_144104_AllowNegativeValuesForOverallocation.php b/database/migrations/2017_08_05_144104_AllowNegativeValuesForOverallocation.php index c543518de..da0a658a6 100644 --- a/database/migrations/2017_08_05_144104_AllowNegativeValuesForOverallocation.php +++ b/database/migrations/2017_08_05_144104_AllowNegativeValuesForOverallocation.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('nodes', function (Blueprint $table) { $table->integer('disk_overallocate')->default(0)->nullable(false)->change(); @@ -20,7 +20,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('nodes', function (Blueprint $table) { DB::statement('ALTER TABLE nodes MODIFY disk_overallocate MEDIUMINT UNSIGNED NULL, diff --git a/database/migrations/2017_08_05_174811_SetAllocationUnqiueUsingMultipleFields.php b/database/migrations/2017_08_05_174811_SetAllocationUnqiueUsingMultipleFields.php index 393f6eedd..bc55bafe7 100644 --- a/database/migrations/2017_08_05_174811_SetAllocationUnqiueUsingMultipleFields.php +++ b/database/migrations/2017_08_05_174811_SetAllocationUnqiueUsingMultipleFields.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('allocations', function (Blueprint $table) { $table->unique(['node_id', 'ip', 'port']); @@ -19,7 +19,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('allocations', function (Blueprint $table) { $table->dropForeign(['node_id']); diff --git a/database/migrations/2017_08_15_214555_CascadeDeletionWhenAParentServiceIsDeleted.php b/database/migrations/2017_08_15_214555_CascadeDeletionWhenAParentServiceIsDeleted.php index 09901e9cb..a1c50d4ab 100644 --- a/database/migrations/2017_08_15_214555_CascadeDeletionWhenAParentServiceIsDeleted.php +++ b/database/migrations/2017_08_15_214555_CascadeDeletionWhenAParentServiceIsDeleted.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropForeign(['service_id']); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropForeign(['service_id']); diff --git a/database/migrations/2017_08_18_215428_RemovePackWhenParentServiceOptionIsDeleted.php b/database/migrations/2017_08_18_215428_RemovePackWhenParentServiceOptionIsDeleted.php index 7eacf1b0d..a3f5d1a50 100644 --- a/database/migrations/2017_08_18_215428_RemovePackWhenParentServiceOptionIsDeleted.php +++ b/database/migrations/2017_08_18_215428_RemovePackWhenParentServiceOptionIsDeleted.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('packs', function (Blueprint $table) { $table->dropForeign(['option_id']); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('packs', function (Blueprint $table) { $table->dropForeign(['option_id']); diff --git a/database/migrations/2017_09_10_225749_RenameTasksTableForStructureRefactor.php b/database/migrations/2017_09_10_225749_RenameTasksTableForStructureRefactor.php index 2a3d826bd..9ecd88f5e 100644 --- a/database/migrations/2017_09_10_225749_RenameTasksTableForStructureRefactor.php +++ b/database/migrations/2017_09_10_225749_RenameTasksTableForStructureRefactor.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::rename('tasks', 'tasks_old'); } @@ -16,7 +16,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::rename('tasks_old', 'tasks'); } diff --git a/database/migrations/2017_09_10_225941_CreateSchedulesTable.php b/database/migrations/2017_09_10_225941_CreateSchedulesTable.php index 0af45c564..b762cab48 100644 --- a/database/migrations/2017_09_10_225941_CreateSchedulesTable.php +++ b/database/migrations/2017_09_10_225941_CreateSchedulesTable.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('schedules', function (Blueprint $table) { $table->increments('id'); @@ -32,7 +32,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('schedules'); } diff --git a/database/migrations/2017_09_10_230309_CreateNewTasksTableForSchedules.php b/database/migrations/2017_09_10_230309_CreateNewTasksTableForSchedules.php index 1c97c29c8..507dad546 100644 --- a/database/migrations/2017_09_10_230309_CreateNewTasksTableForSchedules.php +++ b/database/migrations/2017_09_10_230309_CreateNewTasksTableForSchedules.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('tasks', function (Blueprint $table) { $table->increments('id'); @@ -29,7 +29,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('tasks'); } diff --git a/database/migrations/2017_09_11_002938_TransferOldTasksToNewScheduler.php b/database/migrations/2017_09_11_002938_TransferOldTasksToNewScheduler.php index 9c6488fa5..b25a0c912 100644 --- a/database/migrations/2017_09_11_002938_TransferOldTasksToNewScheduler.php +++ b/database/migrations/2017_09_11_002938_TransferOldTasksToNewScheduler.php @@ -10,7 +10,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { $tasks = DB::table('tasks_old')->get(); @@ -52,7 +52,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::create('tasks_old', function (Blueprint $table) { $table->increments('id'); diff --git a/database/migrations/2017_09_13_211810_UpdateOldPermissionsToPointToNewScheduleSystem.php b/database/migrations/2017_09_13_211810_UpdateOldPermissionsToPointToNewScheduleSystem.php index 04bc48a85..aca8afb6c 100644 --- a/database/migrations/2017_09_13_211810_UpdateOldPermissionsToPointToNewScheduleSystem.php +++ b/database/migrations/2017_09_13_211810_UpdateOldPermissionsToPointToNewScheduleSystem.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { $permissions = DB::table('permissions')->where('permission', 'like', '%-task%')->get(); foreach ($permissions as $record) { @@ -26,7 +26,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { $permissions = DB::table('permissions')->where('permission', 'like', '%-schedule%')->get(); foreach ($permissions as $record) { diff --git a/database/migrations/2017_09_23_170933_CreateDaemonKeysTable.php b/database/migrations/2017_09_23_170933_CreateDaemonKeysTable.php index a33db1e15..114ff9afe 100644 --- a/database/migrations/2017_09_23_170933_CreateDaemonKeysTable.php +++ b/database/migrations/2017_09_23_170933_CreateDaemonKeysTable.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('daemon_keys', function (Blueprint $table) { $table->increments('id'); @@ -28,7 +28,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('daemon_keys'); } diff --git a/database/migrations/2017_09_23_173628_RemoveDaemonSecretFromServersTable.php b/database/migrations/2017_09_23_173628_RemoveDaemonSecretFromServersTable.php index bc7a199c3..ab2e8056e 100644 --- a/database/migrations/2017_09_23_173628_RemoveDaemonSecretFromServersTable.php +++ b/database/migrations/2017_09_23_173628_RemoveDaemonSecretFromServersTable.php @@ -12,7 +12,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { $inserts = []; @@ -41,7 +41,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->char('daemonSecret', 36)->after('startup')->unique(); diff --git a/database/migrations/2017_09_23_185022_RemoveDaemonSecretFromSubusersTable.php b/database/migrations/2017_09_23_185022_RemoveDaemonSecretFromSubusersTable.php index 933a749c7..9090be407 100644 --- a/database/migrations/2017_09_23_185022_RemoveDaemonSecretFromSubusersTable.php +++ b/database/migrations/2017_09_23_185022_RemoveDaemonSecretFromSubusersTable.php @@ -11,7 +11,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { $inserts = []; $subusers = DB::table('subusers')->get(); @@ -39,7 +39,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('subusers', function (Blueprint $table) { $table->char('daemonSecret', 36)->after('server_id'); diff --git a/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php b/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php index e4867b0aa..3ffe5a866 100644 --- a/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php +++ b/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php @@ -11,7 +11,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('services', function (Blueprint $table) { $table->dropUnique(['name']); @@ -39,7 +39,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('services', function (Blueprint $table) { $table->dropColumn('uuid'); diff --git a/database/migrations/2017_10_02_202007_ChangeToABetterUniqueServiceConfiguration.php b/database/migrations/2017_10_02_202007_ChangeToABetterUniqueServiceConfiguration.php index 0d4f7ecba..92d86500e 100644 --- a/database/migrations/2017_10_02_202007_ChangeToABetterUniqueServiceConfiguration.php +++ b/database/migrations/2017_10_02_202007_ChangeToABetterUniqueServiceConfiguration.php @@ -11,7 +11,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_options', function (Blueprint $table) { $table->char('uuid', 36)->after('id'); @@ -40,7 +40,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_options', function (Blueprint $table) { $table->dropColumn('uuid'); diff --git a/database/migrations/2017_10_03_233202_CascadeDeletionWhenServiceOptionIsDeleted.php b/database/migrations/2017_10_03_233202_CascadeDeletionWhenServiceOptionIsDeleted.php index 6c90d1303..de17187c1 100644 --- a/database/migrations/2017_10_03_233202_CascadeDeletionWhenServiceOptionIsDeleted.php +++ b/database/migrations/2017_10_03_233202_CascadeDeletionWhenServiceOptionIsDeleted.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('service_variables', function (Blueprint $table) { $table->dropForeign(['option_id']); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('service_variables', function (Blueprint $table) { $table->dropForeign(['option_id']); diff --git a/database/migrations/2017_10_06_214026_ServicesToNestsConversion.php b/database/migrations/2017_10_06_214026_ServicesToNestsConversion.php index 6821a22fd..ada29a324 100644 --- a/database/migrations/2017_10_06_214026_ServicesToNestsConversion.php +++ b/database/migrations/2017_10_06_214026_ServicesToNestsConversion.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::disableForeignKeyConstraints(); @@ -34,7 +34,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::disableForeignKeyConstraints(); diff --git a/database/migrations/2017_10_06_214053_ServiceOptionsToEggsConversion.php b/database/migrations/2017_10_06_214053_ServiceOptionsToEggsConversion.php index 684c7d41e..1fde279f8 100644 --- a/database/migrations/2017_10_06_214053_ServiceOptionsToEggsConversion.php +++ b/database/migrations/2017_10_06_214053_ServiceOptionsToEggsConversion.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::disableForeignKeyConstraints(); @@ -51,7 +51,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::disableForeignKeyConstraints(); diff --git a/database/migrations/2017_10_06_215741_ServiceVariablesToEggVariablesConversion.php b/database/migrations/2017_10_06_215741_ServiceVariablesToEggVariablesConversion.php index 9479ace7a..aa6816984 100644 --- a/database/migrations/2017_10_06_215741_ServiceVariablesToEggVariablesConversion.php +++ b/database/migrations/2017_10_06_215741_ServiceVariablesToEggVariablesConversion.php @@ -8,7 +8,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::disableForeignKeyConstraints(); @@ -26,7 +26,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::disableForeignKeyConstraints(); diff --git a/database/migrations/2017_10_24_222238_RemoveLegacySFTPInformation.php b/database/migrations/2017_10_24_222238_RemoveLegacySFTPInformation.php index d0735c904..1aef77e19 100644 --- a/database/migrations/2017_10_24_222238_RemoveLegacySFTPInformation.php +++ b/database/migrations/2017_10_24_222238_RemoveLegacySFTPInformation.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->dropUnique(['username']); @@ -22,7 +22,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->string('username')->nullable()->after('image')->unique(); diff --git a/database/migrations/2017_11_11_161922_Add2FaLastAuthorizationTimeColumn.php b/database/migrations/2017_11_11_161922_Add2FaLastAuthorizationTimeColumn.php index 6c4cf7047..1707d43a2 100644 --- a/database/migrations/2017_11_11_161922_Add2FaLastAuthorizationTimeColumn.php +++ b/database/migrations/2017_11_11_161922_Add2FaLastAuthorizationTimeColumn.php @@ -12,7 +12,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->text('totp_secret')->nullable()->change(); @@ -36,7 +36,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { DB::transaction(function () { DB::table('users')->get()->each(function ($user) { diff --git a/database/migrations/2017_11_19_122708_MigratePubPrivFormatToSingleKey.php b/database/migrations/2017_11_19_122708_MigratePubPrivFormatToSingleKey.php index 298cb4cc4..243171ba2 100644 --- a/database/migrations/2017_11_19_122708_MigratePubPrivFormatToSingleKey.php +++ b/database/migrations/2017_11_19_122708_MigratePubPrivFormatToSingleKey.php @@ -12,7 +12,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::transaction(function () { DB::table('api_keys')->get()->each(function ($item) { @@ -39,7 +39,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { DB::statement('ALTER TABLE `api_keys` CHANGE `token` `secret` TEXT, DROP INDEX `api_keys_token_unique`'); diff --git a/database/migrations/2017_12_04_184012_DropAllocationsWhenNodeIsDeleted.php b/database/migrations/2017_12_04_184012_DropAllocationsWhenNodeIsDeleted.php index ff0325606..1f166a997 100644 --- a/database/migrations/2017_12_04_184012_DropAllocationsWhenNodeIsDeleted.php +++ b/database/migrations/2017_12_04_184012_DropAllocationsWhenNodeIsDeleted.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::table('allocations', function (Blueprint $table) { $table->dropForeign(['node_id']); @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('allocations', function (Blueprint $table) { $table->dropForeign(['node_id']); diff --git a/database/migrations/2017_12_12_220426_MigrateSettingsTableToNewFormat.php b/database/migrations/2017_12_12_220426_MigrateSettingsTableToNewFormat.php index e2b5d3b37..7e916861c 100644 --- a/database/migrations/2017_12_12_220426_MigrateSettingsTableToNewFormat.php +++ b/database/migrations/2017_12_12_220426_MigrateSettingsTableToNewFormat.php @@ -10,7 +10,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { DB::table('settings')->truncate(); Schema::table('settings', function (Blueprint $table) { @@ -21,7 +21,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::table('settings', function (Blueprint $table) { $table->dropColumn('id'); diff --git a/database/migrations/2018_01_01_122821_AllowNegativeValuesForServerSwap.php b/database/migrations/2018_01_01_122821_AllowNegativeValuesForServerSwap.php index 8ca76ec1c..64c0d0420 100644 --- a/database/migrations/2018_01_01_122821_AllowNegativeValuesForServerSwap.php +++ b/database/migrations/2018_01_01_122821_AllowNegativeValuesForServerSwap.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->integer('swap')->change(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->unsignedInteger('swap')->change(); diff --git a/database/migrations/2018_01_11_213943_AddApiKeyPermissionColumns.php b/database/migrations/2018_01_11_213943_AddApiKeyPermissionColumns.php index 9ab58e9e9..df8a23a84 100644 --- a/database/migrations/2018_01_11_213943_AddApiKeyPermissionColumns.php +++ b/database/migrations/2018_01_11_213943_AddApiKeyPermissionColumns.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::dropIfExists('api_permissions'); @@ -34,7 +34,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::create('api_permissions', function (Blueprint $table) { $table->increments('id'); diff --git a/database/migrations/2018_01_13_142012_SetupTableForKeyEncryption.php b/database/migrations/2018_01_13_142012_SetupTableForKeyEncryption.php index db103e5f0..1ace88539 100644 --- a/database/migrations/2018_01_13_142012_SetupTableForKeyEncryption.php +++ b/database/migrations/2018_01_13_142012_SetupTableForKeyEncryption.php @@ -14,7 +14,7 @@ return new class extends Migration * @throws \Exception * @throws \Throwable */ - public function up() + public function up(): void { Schema::table('api_keys', function (Blueprint $table) { $table->char('identifier', 16)->nullable()->unique()->after('user_id'); @@ -34,7 +34,7 @@ return new class extends Migration * @throws \Exception * @throws \Throwable */ - public function down() + public function down(): void { Schema::table('api_keys', function (Blueprint $table) { $table->dropColumn('identifier'); diff --git a/database/migrations/2018_01_13_145209_AddLastUsedAtColumn.php b/database/migrations/2018_01_13_145209_AddLastUsedAtColumn.php index d7741c8a2..660967874 100644 --- a/database/migrations/2018_01_13_145209_AddLastUsedAtColumn.php +++ b/database/migrations/2018_01_13_145209_AddLastUsedAtColumn.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('api_keys', function (Blueprint $table) { $table->unsignedTinyInteger('key_type')->after('user_id')->default(0); @@ -31,7 +31,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('api_keys', function (Blueprint $table) { $table->timestamp('expires_at')->after('memo')->nullable(); diff --git a/database/migrations/2018_02_04_145617_AllowTextInUserExternalId.php b/database/migrations/2018_02_04_145617_AllowTextInUserExternalId.php index 6026dc794..85dae2763 100644 --- a/database/migrations/2018_02_04_145617_AllowTextInUserExternalId.php +++ b/database/migrations/2018_02_04_145617_AllowTextInUserExternalId.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('external_id')->nullable()->change(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->unsignedInteger('external_id')->change(); diff --git a/database/migrations/2018_02_10_151150_remove_unique_index_on_external_id_column.php b/database/migrations/2018_02_10_151150_remove_unique_index_on_external_id_column.php index 750a4c724..4d415fae5 100644 --- a/database/migrations/2018_02_10_151150_remove_unique_index_on_external_id_column.php +++ b/database/migrations/2018_02_10_151150_remove_unique_index_on_external_id_column.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->dropUnique(['external_id']); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->unique(['external_id']); diff --git a/database/migrations/2018_02_17_134254_ensure_unique_allocation_id_on_servers_table.php b/database/migrations/2018_02_17_134254_ensure_unique_allocation_id_on_servers_table.php index 25ab9900b..9f0ca1ba2 100644 --- a/database/migrations/2018_02_17_134254_ensure_unique_allocation_id_on_servers_table.php +++ b/database/migrations/2018_02_17_134254_ensure_unique_allocation_id_on_servers_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->unique(['allocation_id']); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropForeign(['allocation_id']); diff --git a/database/migrations/2018_02_24_112356_add_external_id_column_to_servers_table.php b/database/migrations/2018_02_24_112356_add_external_id_column_to_servers_table.php index 17e226233..e9e017523 100644 --- a/database/migrations/2018_02_24_112356_add_external_id_column_to_servers_table.php +++ b/database/migrations/2018_02_24_112356_add_external_id_column_to_servers_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->string('external_id')->after('id')->nullable()->unique(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('external_id'); diff --git a/database/migrations/2018_02_25_160152_remove_default_null_value_on_table.php b/database/migrations/2018_02_25_160152_remove_default_null_value_on_table.php index 44f6ea0ee..47a581728 100644 --- a/database/migrations/2018_02_25_160152_remove_default_null_value_on_table.php +++ b/database/migrations/2018_02_25_160152_remove_default_null_value_on_table.php @@ -13,7 +13,7 @@ return new class extends Migration * @throws \Exception * @throws \Throwable */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('external_id')->default(null)->change(); @@ -31,7 +31,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { // This should not be rolled back. } diff --git a/database/migrations/2018_02_25_160604_define_unique_index_on_users_external_id.php b/database/migrations/2018_02_25_160604_define_unique_index_on_users_external_id.php index 6069eb798..956aa7153 100644 --- a/database/migrations/2018_02_25_160604_define_unique_index_on_users_external_id.php +++ b/database/migrations/2018_02_25_160604_define_unique_index_on_users_external_id.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->index(['external_id']); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropIndex(['external_id']); diff --git a/database/migrations/2018_03_01_192831_add_database_and_port_limit_columns_to_servers_table.php b/database/migrations/2018_03_01_192831_add_database_and_port_limit_columns_to_servers_table.php index cf93c17fb..7de61ef52 100644 --- a/database/migrations/2018_03_01_192831_add_database_and_port_limit_columns_to_servers_table.php +++ b/database/migrations/2018_03_01_192831_add_database_and_port_limit_columns_to_servers_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->unsignedInteger('database_limit')->after('installed')->nullable()->default(0); @@ -24,7 +24,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn(['database_limit', 'allocation_limit']); diff --git a/database/migrations/2018_03_15_124536_add_description_to_nodes.php b/database/migrations/2018_03_15_124536_add_description_to_nodes.php index 75ecc801f..545554691 100644 --- a/database/migrations/2018_03_15_124536_add_description_to_nodes.php +++ b/database/migrations/2018_03_15_124536_add_description_to_nodes.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('nodes', function (Blueprint $table) { $table->text('description')->after('name'); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('nodes', function (Blueprint $table) { $table->dropColumn('description'); diff --git a/database/migrations/2018_05_04_123826_add_maintenance_to_nodes.php b/database/migrations/2018_05_04_123826_add_maintenance_to_nodes.php index aea94707f..ef0902ed2 100644 --- a/database/migrations/2018_05_04_123826_add_maintenance_to_nodes.php +++ b/database/migrations/2018_05_04_123826_add_maintenance_to_nodes.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('nodes', function (Blueprint $table) { $table->boolean('maintenance_mode')->after('behind_proxy')->default(false); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('nodes', function (Blueprint $table) { $table->dropColumn('maintenance_mode'); diff --git a/database/migrations/2018_09_03_143756_allow_egg_variables_to_have_longer_values.php b/database/migrations/2018_09_03_143756_allow_egg_variables_to_have_longer_values.php index b0562c4b7..1379cf0cf 100644 --- a/database/migrations/2018_09_03_143756_allow_egg_variables_to_have_longer_values.php +++ b/database/migrations/2018_09_03_143756_allow_egg_variables_to_have_longer_values.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('egg_variables', function (Blueprint $table) { $table->text('default_value')->change(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('egg_variables', function (Blueprint $table) { $table->string('default_value')->change(); diff --git a/database/migrations/2018_09_03_144005_allow_server_variables_to_have_longer_values.php b/database/migrations/2018_09_03_144005_allow_server_variables_to_have_longer_values.php index 329c8e305..4db0be2bb 100644 --- a/database/migrations/2018_09_03_144005_allow_server_variables_to_have_longer_values.php +++ b/database/migrations/2018_09_03_144005_allow_server_variables_to_have_longer_values.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('server_variables', function (Blueprint $table) { $table->text('variable_value')->change(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('server_variables', function (Blueprint $table) { $table->string('variable_value')->change(); diff --git a/database/migrations/2019_03_02_142328_set_allocation_limit_default_null.php b/database/migrations/2019_03_02_142328_set_allocation_limit_default_null.php index 92e4ae7c7..9c54502f7 100644 --- a/database/migrations/2019_03_02_142328_set_allocation_limit_default_null.php +++ b/database/migrations/2019_03_02_142328_set_allocation_limit_default_null.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->unsignedInteger('allocation_limit')->nullable()->default(null)->change(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->unsignedInteger('allocation_limit')->nullable()->default(0)->change(); diff --git a/database/migrations/2019_03_02_151321_fix_unique_index_to_account_for_host.php b/database/migrations/2019_03_02_151321_fix_unique_index_to_account_for_host.php index 06acdafb6..e6cdb72d3 100644 --- a/database/migrations/2019_03_02_151321_fix_unique_index_to_account_for_host.php +++ b/database/migrations/2019_03_02_151321_fix_unique_index_to_account_for_host.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('databases', function (Blueprint $table) { $table->dropUnique(['database']); @@ -27,7 +27,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('databases', function (Blueprint $table) { $table->dropForeign(['database_host_id']); 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 79ddbea3b..67246475f 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 @@ -64,7 +64,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('subusers', function (Blueprint $table) { $table->json('permissions')->nullable()->after('server_id'); @@ -101,7 +101,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { $flipped = array_flip(array_filter(self::$permissionsMap)); diff --git a/database/migrations/2020_03_22_164814_drop_permissions_table.php b/database/migrations/2020_03_22_164814_drop_permissions_table.php index 8f167e203..adb1dad62 100644 --- a/database/migrations/2020_03_22_164814_drop_permissions_table.php +++ b/database/migrations/2020_03_22_164814_drop_permissions_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::dropIfExists('permissions'); } @@ -21,7 +21,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::create('permissions', function (Blueprint $table) { $table->increments('id'); diff --git a/database/migrations/2020_04_03_203624_add_threads_column_to_servers_table.php b/database/migrations/2020_04_03_203624_add_threads_column_to_servers_table.php index b60402000..e405d5c71 100644 --- a/database/migrations/2020_04_03_203624_add_threads_column_to_servers_table.php +++ b/database/migrations/2020_04_03_203624_add_threads_column_to_servers_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->string('threads')->nullable()->after('cpu'); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('threads'); 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 ecc553d0f..d29e439a1 100644 --- a/database/migrations/2020_04_03_230614_create_backups_table.php +++ b/database/migrations/2020_04_03_230614_create_backups_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { $db = config('database.default'); // There exists a backups plugin for the 0.7 version of the Panel. However, it didn't properly @@ -52,7 +52,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('backups'); } diff --git a/database/migrations/2020_04_04_131016_add_table_server_transfers.php b/database/migrations/2020_04_04_131016_add_table_server_transfers.php index 6128ebb46..1372cf463 100644 --- a/database/migrations/2020_04_04_131016_add_table_server_transfers.php +++ b/database/migrations/2020_04_04_131016_add_table_server_transfers.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { // Nuclear approach to whatever plugins are out there and not properly namespacing their own tables // leading to constant support requests from people... @@ -38,7 +38,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('server_transfers'); } diff --git a/database/migrations/2020_04_10_141024_store_node_tokens_as_encrypted_value.php b/database/migrations/2020_04_10_141024_store_node_tokens_as_encrypted_value.php index 28f897f16..d2e4cafed 100644 --- a/database/migrations/2020_04_10_141024_store_node_tokens_as_encrypted_value.php +++ b/database/migrations/2020_04_10_141024_store_node_tokens_as_encrypted_value.php @@ -15,7 +15,7 @@ return new class extends Migration * * @throws \Exception */ - public function up() + public function up(): void { Schema::table('nodes', function (Blueprint $table) { $table->dropUnique(['daemonSecret']); @@ -51,7 +51,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { DB::transaction(function () { foreach (DB::select('SELECT id, daemon_token_id, daemon_token FROM nodes') as $datum) { diff --git a/database/migrations/2020_04_17_203438_allow_nullable_descriptions.php b/database/migrations/2020_04_17_203438_allow_nullable_descriptions.php index df8896b76..1c9a69b54 100644 --- a/database/migrations/2020_04_17_203438_allow_nullable_descriptions.php +++ b/database/migrations/2020_04_17_203438_allow_nullable_descriptions.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('eggs', function (Blueprint $table) { $table->text('description')->nullable()->change(); @@ -35,7 +35,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('eggs', function (Blueprint $table) { $table->text('description')->nullable(false)->change(); diff --git a/database/migrations/2020_04_22_055500_add_max_connections_column.php b/database/migrations/2020_04_22_055500_add_max_connections_column.php index 0e7b7ed90..ea6ff5376 100644 --- a/database/migrations/2020_04_22_055500_add_max_connections_column.php +++ b/database/migrations/2020_04_22_055500_add_max_connections_column.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('databases', function (Blueprint $table) { $table->integer('max_connections')->nullable()->default(0)->after('password'); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('databases', function (Blueprint $table) { $table->dropColumn('max_connections'); diff --git a/database/migrations/2020_04_26_111208_add_backup_limit_to_servers.php b/database/migrations/2020_04_26_111208_add_backup_limit_to_servers.php index 7842cdede..d8842b521 100644 --- a/database/migrations/2020_04_26_111208_add_backup_limit_to_servers.php +++ b/database/migrations/2020_04_26_111208_add_backup_limit_to_servers.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { $db = config('database.default'); // Same as in the backups migration, we need to handle that plugin messing with the data structure @@ -38,7 +38,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('backup_limit'); diff --git a/database/migrations/2020_05_20_234655_add_mounts_table.php b/database/migrations/2020_05_20_234655_add_mounts_table.php index edc28b21f..9ecc8f9ac 100644 --- a/database/migrations/2020_05_20_234655_add_mounts_table.php +++ b/database/migrations/2020_05_20_234655_add_mounts_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('mounts', function (Blueprint $table) { $table->increments('id')->unique(); @@ -44,7 +44,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('mount_node'); Schema::dropIfExists('egg_mount'); diff --git a/database/migrations/2020_05_21_192756_add_mount_server_table.php b/database/migrations/2020_05_21_192756_add_mount_server_table.php index 593cf58d4..62d736f0f 100644 --- a/database/migrations/2020_05_21_192756_add_mount_server_table.php +++ b/database/migrations/2020_05_21_192756_add_mount_server_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('mount_server', function (Blueprint $table) { $table->integer('server_id'); @@ -26,7 +26,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('mount_server'); } diff --git a/database/migrations/2020_07_02_213612_create_user_recovery_tokens_table.php b/database/migrations/2020_07_02_213612_create_user_recovery_tokens_table.php index 9cb435cdb..65d22e196 100644 --- a/database/migrations/2020_07_02_213612_create_user_recovery_tokens_table.php +++ b/database/migrations/2020_07_02_213612_create_user_recovery_tokens_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('recovery_tokens', function (Blueprint $table) { $table->id(); @@ -28,7 +28,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('recovery_tokens'); } diff --git a/database/migrations/2020_07_09_201845_add_notes_column_for_allocations.php b/database/migrations/2020_07_09_201845_add_notes_column_for_allocations.php index 6663a1c90..d9c97a96c 100644 --- a/database/migrations/2020_07_09_201845_add_notes_column_for_allocations.php +++ b/database/migrations/2020_07_09_201845_add_notes_column_for_allocations.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('allocations', function (Blueprint $table) { $table->string('notes')->nullable()->after('server_id'); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('allocations', function (Blueprint $table) { $table->dropColumn('notes'); diff --git a/database/migrations/2020_08_20_205533_add_backup_state_column_to_backups.php b/database/migrations/2020_08_20_205533_add_backup_state_column_to_backups.php index a3b7e06e5..75db377d7 100644 --- a/database/migrations/2020_08_20_205533_add_backup_state_column_to_backups.php +++ b/database/migrations/2020_08_20_205533_add_backup_state_column_to_backups.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('backups', function (Blueprint $table) { $table->boolean('is_successful')->after('uuid')->default(true); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('backups', function (Blueprint $table) { $table->dropColumn('is_successful'); diff --git a/database/migrations/2020_08_22_132500_update_bytes_to_unsigned_bigint.php b/database/migrations/2020_08_22_132500_update_bytes_to_unsigned_bigint.php index 372a26175..5c846145a 100644 --- a/database/migrations/2020_08_22_132500_update_bytes_to_unsigned_bigint.php +++ b/database/migrations/2020_08_22_132500_update_bytes_to_unsigned_bigint.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('backups', function (Blueprint $table) { $table->unsignedBigInteger('bytes')->default(0)->change(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('backups', function (Blueprint $table) { $table->integer('bytes')->default(0)->change(); diff --git a/database/migrations/2020_08_23_175331_modify_checksums_column_for_backups.php b/database/migrations/2020_08_23_175331_modify_checksums_column_for_backups.php index 459bf2f8c..fdf3e4a95 100644 --- a/database/migrations/2020_08_23_175331_modify_checksums_column_for_backups.php +++ b/database/migrations/2020_08_23_175331_modify_checksums_column_for_backups.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('backups', function (Blueprint $table) { $table->renameColumn('sha256_hash', 'checksum'); @@ -28,7 +28,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('backups', function (Blueprint $table) { $table->renameColumn('checksum', 'sha256_hash'); diff --git a/database/migrations/2020_09_13_110007_drop_packs_from_servers.php b/database/migrations/2020_09_13_110007_drop_packs_from_servers.php index 79c5024ca..026a95d53 100644 --- a/database/migrations/2020_09_13_110007_drop_packs_from_servers.php +++ b/database/migrations/2020_09_13_110007_drop_packs_from_servers.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->dropForeign(['pack_id']); @@ -24,7 +24,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->unsignedInteger('pack_id')->after('egg_id')->nullable(); diff --git a/database/migrations/2020_09_13_110021_drop_packs_from_api_key_permissions.php b/database/migrations/2020_09_13_110021_drop_packs_from_api_key_permissions.php index 969f70fc5..f7341ff19 100644 --- a/database/migrations/2020_09_13_110021_drop_packs_from_api_key_permissions.php +++ b/database/migrations/2020_09_13_110021_drop_packs_from_api_key_permissions.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('api_keys', function (Blueprint $table) { $table->dropColumn('r_packs'); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('api_keys', function (Blueprint $table) { $table->unsignedTinyInteger('r_packs')->default(0); diff --git a/database/migrations/2020_09_13_110047_drop_packs_table.php b/database/migrations/2020_09_13_110047_drop_packs_table.php index cd58f3db0..8ec5f54a7 100644 --- a/database/migrations/2020_09_13_110047_drop_packs_table.php +++ b/database/migrations/2020_09_13_110047_drop_packs_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::dropIfExists('packs'); } @@ -21,7 +21,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::create('packs', function (Blueprint $table) { $table->increments('id'); diff --git a/database/migrations/2020_09_13_113503_drop_daemon_key_table.php b/database/migrations/2020_09_13_113503_drop_daemon_key_table.php index 1eb1f4217..425129761 100644 --- a/database/migrations/2020_09_13_113503_drop_daemon_key_table.php +++ b/database/migrations/2020_09_13_113503_drop_daemon_key_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::dropIfExists('daemon_keys'); } @@ -21,7 +21,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::create('daemon_keys', function (Blueprint $table) { $table->increments('id'); diff --git a/database/migrations/2020_10_10_165437_change_unique_database_name_to_account_for_server.php b/database/migrations/2020_10_10_165437_change_unique_database_name_to_account_for_server.php index 122b1a25b..24cba6084 100644 --- a/database/migrations/2020_10_10_165437_change_unique_database_name_to_account_for_server.php +++ b/database/migrations/2020_10_10_165437_change_unique_database_name_to_account_for_server.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('databases', function (Blueprint $table) { $table->dropUnique(['database_host_id', 'database']); @@ -27,7 +27,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('databases', function (Blueprint $table) { $table->dropUnique(['database_host_id', 'server_id', 'database']); diff --git a/database/migrations/2020_10_26_194904_remove_nullable_from_schedule_name_field.php b/database/migrations/2020_10_26_194904_remove_nullable_from_schedule_name_field.php index d89b6fc42..a4f461812 100644 --- a/database/migrations/2020_10_26_194904_remove_nullable_from_schedule_name_field.php +++ b/database/migrations/2020_10_26_194904_remove_nullable_from_schedule_name_field.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { DB::update("UPDATE schedules SET name = 'Schedule' WHERE name IS NULL OR name = ''"); @@ -26,7 +26,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('schedules', function (Blueprint $table) { $table->string('name')->nullable()->change(); diff --git a/database/migrations/2020_11_02_201014_add_features_column_to_eggs.php b/database/migrations/2020_11_02_201014_add_features_column_to_eggs.php index fa9bcd8e1..04378e308 100644 --- a/database/migrations/2020_11_02_201014_add_features_column_to_eggs.php +++ b/database/migrations/2020_11_02_201014_add_features_column_to_eggs.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('eggs', function (Blueprint $table) { $table->json('features')->after('description')->nullable(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('eggs', function (Blueprint $table) { $table->dropColumn('features'); diff --git a/database/migrations/2020_12_12_102435_support_multiple_docker_images_and_updates.php b/database/migrations/2020_12_12_102435_support_multiple_docker_images_and_updates.php index 9d49ae272..bf66a2ec7 100644 --- a/database/migrations/2020_12_12_102435_support_multiple_docker_images_and_updates.php +++ b/database/migrations/2020_12_12_102435_support_multiple_docker_images_and_updates.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('eggs', function (Blueprint $table) { $table->json('docker_images')->after('docker_image')->nullable(); @@ -33,7 +33,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('eggs', function (Blueprint $table) { $table->text('docker_image')->after('docker_images'); diff --git a/database/migrations/2020_12_14_013707_make_successful_nullable_in_server_transfers.php b/database/migrations/2020_12_14_013707_make_successful_nullable_in_server_transfers.php index 2b1a38497..299d510d6 100644 --- a/database/migrations/2020_12_14_013707_make_successful_nullable_in_server_transfers.php +++ b/database/migrations/2020_12_14_013707_make_successful_nullable_in_server_transfers.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('server_transfers', function (Blueprint $table) { $table->boolean('successful')->nullable()->default(null)->change(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('server_transfers', function (Blueprint $table) { $table->boolean('successful')->default(0)->change(); diff --git a/database/migrations/2020_12_17_014330_add_archived_field_to_server_transfers_table.php b/database/migrations/2020_12_17_014330_add_archived_field_to_server_transfers_table.php index 5bcec883c..d271eef18 100644 --- a/database/migrations/2020_12_17_014330_add_archived_field_to_server_transfers_table.php +++ b/database/migrations/2020_12_17_014330_add_archived_field_to_server_transfers_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('server_transfers', function (Blueprint $table) { $table->boolean('archived')->default(0)->after('new_additional_allocations'); @@ -29,7 +29,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('server_transfers', function (Blueprint $table) { $table->dropColumn('archived'); diff --git a/database/migrations/2020_12_24_092449_make_allocation_fields_json.php b/database/migrations/2020_12_24_092449_make_allocation_fields_json.php index e5ffcc5d1..587272757 100644 --- a/database/migrations/2020_12_24_092449_make_allocation_fields_json.php +++ b/database/migrations/2020_12_24_092449_make_allocation_fields_json.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('server_transfers', function (Blueprint $table) { $table->json('old_additional_allocations')->nullable()->change(); @@ -24,7 +24,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('server_transfers', function (Blueprint $table) { $table->string('old_additional_allocations')->nullable()->change(); diff --git a/database/migrations/2020_12_26_184914_add_upload_id_column_to_backups_table.php b/database/migrations/2020_12_26_184914_add_upload_id_column_to_backups_table.php index 7e71d0663..0cc7edaa7 100644 --- a/database/migrations/2020_12_26_184914_add_upload_id_column_to_backups_table.php +++ b/database/migrations/2020_12_26_184914_add_upload_id_column_to_backups_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('backups', function (Blueprint $table) { $table->text('upload_id')->nullable()->after('uuid'); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('backups', function (Blueprint $table) { $table->dropColumn('upload_id'); diff --git a/database/migrations/2021_01_10_153937_add_file_denylist_to_egg_configs.php b/database/migrations/2021_01_10_153937_add_file_denylist_to_egg_configs.php index cea080432..5e4065479 100644 --- a/database/migrations/2021_01_10_153937_add_file_denylist_to_egg_configs.php +++ b/database/migrations/2021_01_10_153937_add_file_denylist_to_egg_configs.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('eggs', function (Blueprint $table) { $table->text('file_denylist')->after('docker_images'); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('eggs', function (Blueprint $table) { $table->dropColumn('file_denylist'); diff --git a/database/migrations/2021_01_13_013420_add_cron_month.php b/database/migrations/2021_01_13_013420_add_cron_month.php index 035c71eb3..07bb99f18 100644 --- a/database/migrations/2021_01_13_013420_add_cron_month.php +++ b/database/migrations/2021_01_13_013420_add_cron_month.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('schedules', function (Blueprint $table) { $table->string('cron_month')->after('cron_day_of_week'); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('schedules', function (Blueprint $table) { $table->dropColumn('cron_month'); diff --git a/database/migrations/2021_01_17_102401_create_audit_logs_table.php b/database/migrations/2021_01_17_102401_create_audit_logs_table.php index 20fd0ac61..4caa124d2 100644 --- a/database/migrations/2021_01_17_102401_create_audit_logs_table.php +++ b/database/migrations/2021_01_17_102401_create_audit_logs_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('audit_logs', function (Blueprint $table) { $table->id(); @@ -35,7 +35,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('audit_logs'); } diff --git a/database/migrations/2021_01_17_152623_add_generic_server_status_column.php b/database/migrations/2021_01_17_152623_add_generic_server_status_column.php index 661bf7b0c..cbeaba8b2 100644 --- a/database/migrations/2021_01_17_152623_add_generic_server_status_column.php +++ b/database/migrations/2021_01_17_152623_add_generic_server_status_column.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->string('status')->nullable()->after('description'); @@ -35,7 +35,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->unsignedTinyInteger('suspended')->default(0); diff --git a/database/migrations/2021_01_26_210502_update_file_denylist_to_json.php b/database/migrations/2021_01_26_210502_update_file_denylist_to_json.php index 8b3d2455c..fdd48f632 100644 --- a/database/migrations/2021_01_26_210502_update_file_denylist_to_json.php +++ b/database/migrations/2021_01_26_210502_update_file_denylist_to_json.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('eggs', function (Blueprint $table) { $table->dropColumn('file_denylist'); @@ -27,7 +27,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('eggs', function (Blueprint $table) { $table->dropColumn('file_denylist'); 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 1c9e208db..ea297bb46 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 @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('audit_logs', function (Blueprint $table) { // Doing the index in this order lets me use the action alone without the server @@ -30,7 +30,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('audit_logs', function (Blueprint $table) { $table->dropIndex(['action', 'server_id']); diff --git a/database/migrations/2021_02_23_212657_make_sftp_port_unsigned_int.php b/database/migrations/2021_02_23_212657_make_sftp_port_unsigned_int.php index 38ece3ab7..a66cadb66 100644 --- a/database/migrations/2021_02_23_212657_make_sftp_port_unsigned_int.php +++ b/database/migrations/2021_02_23_212657_make_sftp_port_unsigned_int.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('nodes', function (Blueprint $table) { $table->unsignedSmallInteger('daemonSFTP')->default(2022)->change(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('nodes', function (Blueprint $table) { $table->smallInteger('daemonSFTP')->default(2022)->change(); diff --git a/database/migrations/2021_03_21_104718_force_cron_month_field_to_have_value_if_missing.php b/database/migrations/2021_03_21_104718_force_cron_month_field_to_have_value_if_missing.php index f3c4302f8..e337dc024 100644 --- a/database/migrations/2021_03_21_104718_force_cron_month_field_to_have_value_if_missing.php +++ b/database/migrations/2021_03_21_104718_force_cron_month_field_to_have_value_if_missing.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('schedules', function (Blueprint $table) { DB::update("UPDATE `schedules` SET `cron_month` = '*' WHERE `cron_month` = ''"); @@ -24,7 +24,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { // No down function. } diff --git a/database/migrations/2021_05_01_092457_add_continue_on_failure_option_to_tasks.php b/database/migrations/2021_05_01_092457_add_continue_on_failure_option_to_tasks.php index 5475e4f5e..31d1a1149 100644 --- a/database/migrations/2021_05_01_092457_add_continue_on_failure_option_to_tasks.php +++ b/database/migrations/2021_05_01_092457_add_continue_on_failure_option_to_tasks.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('tasks', function (Blueprint $table) { $table->unsignedTinyInteger('continue_on_failure')->after('is_queued')->default(0); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('tasks', function (Blueprint $table) { $table->dropColumn('continue_on_failure'); diff --git a/database/migrations/2021_05_01_092523_add_only_run_when_server_online_option_to_schedules.php b/database/migrations/2021_05_01_092523_add_only_run_when_server_online_option_to_schedules.php index 70603edb3..89dff7866 100644 --- a/database/migrations/2021_05_01_092523_add_only_run_when_server_online_option_to_schedules.php +++ b/database/migrations/2021_05_01_092523_add_only_run_when_server_online_option_to_schedules.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('schedules', function (Blueprint $table) { $table->unsignedTinyInteger('only_when_online')->after('is_processing')->default(0); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('schedules', function (Blueprint $table) { $table->dropColumn('only_when_online'); diff --git a/database/migrations/2021_05_03_201016_add_support_for_locking_a_backup.php b/database/migrations/2021_05_03_201016_add_support_for_locking_a_backup.php index 39e8d3ae9..02c6e6cd2 100644 --- a/database/migrations/2021_05_03_201016_add_support_for_locking_a_backup.php +++ b/database/migrations/2021_05_03_201016_add_support_for_locking_a_backup.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('backups', function (Blueprint $table) { $table->unsignedTinyInteger('is_locked')->after('is_successful')->default(0); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('backups', function (Blueprint $table) { $table->dropColumn('is_locked'); diff --git a/database/migrations/2021_07_12_013420_remove_userinteraction.php b/database/migrations/2021_07_12_013420_remove_userinteraction.php index 8a9840d2e..b51918856 100644 --- a/database/migrations/2021_07_12_013420_remove_userinteraction.php +++ b/database/migrations/2021_07_12_013420_remove_userinteraction.php @@ -10,7 +10,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { // Remove User Interaction from startup config DB::table('eggs')->update([ @@ -18,7 +18,7 @@ return new class extends Migration ]); } - public function down() + public function down(): void { // Add blank User Interaction array back to startup config DB::table('eggs')->update([ diff --git a/database/migrations/2021_07_17_211512_create_user_ssh_keys_table.php b/database/migrations/2021_07_17_211512_create_user_ssh_keys_table.php index 2f3e19536..235151439 100644 --- a/database/migrations/2021_07_17_211512_create_user_ssh_keys_table.php +++ b/database/migrations/2021_07_17_211512_create_user_ssh_keys_table.php @@ -9,7 +9,7 @@ return new class extends Migration /** * Run the migrations. */ - public function up() + public function up(): void { Schema::create('user_ssh_keys', function (Blueprint $table) { $table->increments('id'); @@ -27,7 +27,7 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down() + public function down(): void { Schema::dropIfExists('user_ssh_keys'); } diff --git a/database/migrations/2021_08_03_210600_change_successful_field_to_default_to_false_on_backups_table.php b/database/migrations/2021_08_03_210600_change_successful_field_to_default_to_false_on_backups_table.php index 8857ff71a..fa25478ea 100644 --- a/database/migrations/2021_08_03_210600_change_successful_field_to_default_to_false_on_backups_table.php +++ b/database/migrations/2021_08_03_210600_change_successful_field_to_default_to_false_on_backups_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('backups', function (Blueprint $table) { $table->boolean('is_successful')->after('uuid')->default(false)->change(); @@ -29,7 +29,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('backups', function (Blueprint $table) { $table->boolean('is_successful')->after('uuid')->default(true)->change(); diff --git a/database/migrations/2021_08_21_175111_add_foreign_keys_to_mount_node_table.php b/database/migrations/2021_08_21_175111_add_foreign_keys_to_mount_node_table.php index 3a6f9b62b..c535562e2 100644 --- a/database/migrations/2021_08_21_175111_add_foreign_keys_to_mount_node_table.php +++ b/database/migrations/2021_08_21_175111_add_foreign_keys_to_mount_node_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { // Fix the columns having a different type than their relations. Schema::table('mount_node', function (Blueprint $table) { @@ -49,7 +49,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('mount_node', function (Blueprint $table) { $table->dropForeign(['node_id']); diff --git a/database/migrations/2021_08_21_175118_add_foreign_keys_to_mount_server_table.php b/database/migrations/2021_08_21_175118_add_foreign_keys_to_mount_server_table.php index 7ac9dc5f3..fc334cdd6 100644 --- a/database/migrations/2021_08_21_175118_add_foreign_keys_to_mount_server_table.php +++ b/database/migrations/2021_08_21_175118_add_foreign_keys_to_mount_server_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { // Fix the columns having a different type than their relations. Schema::table('mount_server', function (Blueprint $table) { @@ -48,7 +48,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('mount_server', function (Blueprint $table) { $table->dropForeign(['server_id']); diff --git a/database/migrations/2021_08_21_180921_add_foreign_keys_to_egg_mount_table.php b/database/migrations/2021_08_21_180921_add_foreign_keys_to_egg_mount_table.php index ef89771e2..53b7d92c8 100644 --- a/database/migrations/2021_08_21_180921_add_foreign_keys_to_egg_mount_table.php +++ b/database/migrations/2021_08_21_180921_add_foreign_keys_to_egg_mount_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { // Fix the columns having a different type than their relations. Schema::table('egg_mount', function (Blueprint $table) { @@ -48,7 +48,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('egg_mount', function (Blueprint $table) { $table->dropForeign(['egg_id']); diff --git a/database/migrations/2022_01_25_030847_drop_google_analytics.php b/database/migrations/2022_01_25_030847_drop_google_analytics.php index 2e2ecbaba..d3669a3f3 100644 --- a/database/migrations/2022_01_25_030847_drop_google_analytics.php +++ b/database/migrations/2022_01_25_030847_drop_google_analytics.php @@ -10,7 +10,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { DB::table('settings')->where('key', 'settings::app:analytics')->delete(); } @@ -20,7 +20,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { DB::table('settings')->insert( [ diff --git a/database/migrations/2022_05_07_165334_migrate_egg_images_array_to_new_format.php b/database/migrations/2022_05_07_165334_migrate_egg_images_array_to_new_format.php index 172644073..90c726a37 100644 --- a/database/migrations/2022_05_07_165334_migrate_egg_images_array_to_new_format.php +++ b/database/migrations/2022_05_07_165334_migrate_egg_images_array_to_new_format.php @@ -10,7 +10,7 @@ return new class extends Migration * images array to both exist, and have key => value pairings to support naming the * images provided. */ - public function up() + public function up(): void { DB::table('eggs')->select(['id', 'docker_images'])->cursor()->each(function ($egg) { $images = is_null($egg->docker_images) ? [] : json_decode($egg->docker_images, true, 512, JSON_THROW_ON_ERROR); @@ -29,7 +29,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { DB::table('eggs')->select(['id', 'docker_images'])->cursor()->each(function ($egg) { DB::table('eggs')->where('id', $egg->id)->update([ diff --git a/database/migrations/2022_05_28_135717_create_activity_logs_table.php b/database/migrations/2022_05_28_135717_create_activity_logs_table.php index c3eeb5ffb..7890ec678 100644 --- a/database/migrations/2022_05_28_135717_create_activity_logs_table.php +++ b/database/migrations/2022_05_28_135717_create_activity_logs_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('activity_logs', function (Blueprint $table) { $table->id(); @@ -30,7 +30,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('activity_logs'); } diff --git a/database/migrations/2022_05_29_140349_create_activity_log_actors_table.php b/database/migrations/2022_05_29_140349_create_activity_log_actors_table.php index ff549ed4d..930b579b3 100644 --- a/database/migrations/2022_05_29_140349_create_activity_log_actors_table.php +++ b/database/migrations/2022_05_29_140349_create_activity_log_actors_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('activity_log_subjects', function (Blueprint $table) { $table->id(); @@ -25,7 +25,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('activity_log_subjects'); } diff --git a/database/migrations/2022_06_18_112822_track_api_key_usage_for_activity_events.php b/database/migrations/2022_06_18_112822_track_api_key_usage_for_activity_events.php index 50c383db9..85abc251d 100644 --- a/database/migrations/2022_06_18_112822_track_api_key_usage_for_activity_events.php +++ b/database/migrations/2022_06_18_112822_track_api_key_usage_for_activity_events.php @@ -11,7 +11,7 @@ return new class() extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('activity_logs', function (Blueprint $table) { $table->unsignedInteger('api_key_id')->nullable()->after('actor_id'); @@ -23,7 +23,7 @@ return new class() extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('activity_logs', function (Blueprint $table) { $table->dropColumn('api_key_id'); diff --git a/database/migrations/2022_08_16_214400_add_force_outgoing_ip_column_to_eggs_table.php b/database/migrations/2022_08_16_214400_add_force_outgoing_ip_column_to_eggs_table.php index f338cf55f..678f54ab1 100644 --- a/database/migrations/2022_08_16_214400_add_force_outgoing_ip_column_to_eggs_table.php +++ b/database/migrations/2022_08_16_214400_add_force_outgoing_ip_column_to_eggs_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('eggs', function (Blueprint $table) { $table->boolean('force_outgoing_ip')->default(false); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('eggs', function (Blueprint $table) { $table->dropColumn('force_outgoing_ip'); diff --git a/database/migrations/2022_08_16_230204_add_installed_at_column_to_servers_table.php b/database/migrations/2022_08_16_230204_add_installed_at_column_to_servers_table.php index cbd02489f..ac49ec572 100644 --- a/database/migrations/2022_08_16_230204_add_installed_at_column_to_servers_table.php +++ b/database/migrations/2022_08_16_230204_add_installed_at_column_to_servers_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('servers', function (Blueprint $table) { $table->timestamp('installed_at')->nullable(); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('servers', function (Blueprint $table) { $table->dropColumn('installed_at'); diff --git a/tests/Integration/Api/Application/EggControllerTest.php b/tests/Integration/Api/Application/EggControllerTest.php index c8e88c171..14a41cd6a 100644 --- a/tests/Integration/Api/Application/EggControllerTest.php +++ b/tests/Integration/Api/Application/EggControllerTest.php @@ -12,7 +12,7 @@ class EggControllerTest extends ApplicationApiIntegrationTestCase /** * Test that all the eggs can be returned. */ - public function testListAllEggs() + public function testListAllEggs(): void { $eggs = Egg::query()->get(); @@ -56,7 +56,7 @@ class EggControllerTest extends ApplicationApiIntegrationTestCase /** * Test that a single egg can be returned. */ - public function testReturnSingleEgg() + public function testReturnSingleEgg(): void { $egg = Egg::query()->findOrFail(1); @@ -78,7 +78,7 @@ class EggControllerTest extends ApplicationApiIntegrationTestCase /** * Test that a single egg and all the defined relationships can be returned. */ - public function testReturnSingleEggWithRelationships() + public function testReturnSingleEggWithRelationships(): void { $egg = Egg::query()->findOrFail(1); @@ -98,7 +98,7 @@ class EggControllerTest extends ApplicationApiIntegrationTestCase /** * Test that a missing egg returns a 404 error. */ - public function testGetMissingEgg() + public function testGetMissingEgg(): void { $response = $this->getJson('/api/application/eggs/nil'); $this->assertNotFoundJson($response); @@ -108,7 +108,7 @@ class EggControllerTest extends ApplicationApiIntegrationTestCase * Test that an authentication error occurs if a key does not have permission * to access a resource. */ - public function testErrorReturnedIfNoPermission() + public function testErrorReturnedIfNoPermission(): void { $egg = Egg::query()->findOrFail(1); $this->createNewDefaultApiKey($this->getApiUser(), ['r_eggs' => 0]); diff --git a/tests/Integration/Api/Application/Users/ExternalUserControllerTest.php b/tests/Integration/Api/Application/Users/ExternalUserControllerTest.php index 08210ddbc..26506b7a5 100644 --- a/tests/Integration/Api/Application/Users/ExternalUserControllerTest.php +++ b/tests/Integration/Api/Application/Users/ExternalUserControllerTest.php @@ -12,7 +12,7 @@ class ExternalUserControllerTest extends ApplicationApiIntegrationTestCase /** * Test that a user can be retrieved by their external ID. */ - public function testGetRemoteUser() + public function testGetRemoteUser(): void { $user = User::factory()->create(['external_id' => Str::random()]); @@ -49,7 +49,7 @@ class ExternalUserControllerTest extends ApplicationApiIntegrationTestCase /** * Test that an invalid external ID returns a 404 error. */ - public function testGetMissingUser() + public function testGetMissingUser(): void { $response = $this->getJson('/api/application/users/external/nil'); $this->assertNotFoundJson($response); @@ -59,7 +59,7 @@ class ExternalUserControllerTest extends ApplicationApiIntegrationTestCase * Test that an authentication error occurs if a key does not have permission * to access a resource. */ - public function testErrorReturnedIfNoPermission() + public function testErrorReturnedIfNoPermission(): void { $user = User::factory()->create(['external_id' => Str::random()]); $this->createNewDefaultApiKey($this->getApiUser(), ['r_users' => 0]); diff --git a/tests/Integration/Api/Application/Users/UserControllerTest.php b/tests/Integration/Api/Application/Users/UserControllerTest.php index e74f1c74b..56887fc3d 100644 --- a/tests/Integration/Api/Application/Users/UserControllerTest.php +++ b/tests/Integration/Api/Application/Users/UserControllerTest.php @@ -14,7 +14,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase /** * Test the response when requesting all users on the panel. */ - public function testGetUsers() + public function testGetUsers(): void { $user = User::factory()->create(); @@ -83,7 +83,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase /** * Test getting a single user. */ - public function testGetSingleUser() + public function testGetSingleUser(): void { $user = User::factory()->create(); @@ -117,7 +117,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase /** * Test that the correct relationships can be loaded. */ - public function testRelationshipsCanBeLoaded() + public function testRelationshipsCanBeLoaded(): void { $user = User::factory()->create(); $server = $this->createServerModel(['user_id' => $user->id]); @@ -148,7 +148,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase * Test that attempting to load a relationship that the key does not have permission * for returns a null object. */ - public function testKeyWithoutPermissionCannotLoadRelationship() + public function testKeyWithoutPermissionCannotLoadRelationship(): void { $this->createNewDefaultApiKey($this->getApiUser(), ['r_servers' => 0]); @@ -182,7 +182,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase /** * Test that an invalid external ID returns a 404 error. */ - public function testGetMissingUser() + public function testGetMissingUser(): void { $response = $this->getJson('/api/application/users/nil'); $this->assertNotFoundJson($response); @@ -192,7 +192,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase * Test that an authentication error occurs if a key does not have permission * to access a resource. */ - public function testErrorReturnedIfNoPermission() + public function testErrorReturnedIfNoPermission(): void { $user = User::factory()->create(); $this->createNewDefaultApiKey($this->getApiUser(), ['r_users' => 0]); @@ -204,7 +204,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase /** * Test that a user can be created. */ - public function testCreateUser() + public function testCreateUser(): void { $response = $this->postJson('/api/application/users', [ 'username' => 'testuser', @@ -236,7 +236,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase /** * Test that a user can be updated. */ - public function testUpdateUser() + public function testUpdateUser(): void { $user = User::factory()->create(); @@ -265,7 +265,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase /** * Test that a user can be deleted from the database. */ - public function testDeleteUser() + public function testDeleteUser(): void { $user = User::factory()->create(); $this->assertDatabaseHas('users', ['id' => $user->id]); @@ -282,7 +282,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase * * @dataProvider userWriteEndpointsDataProvider */ - public function testApiKeyWithoutWritePermissions(string $method, string $url) + public function testApiKeyWithoutWritePermissions(string $method, string $url): void { $this->createNewDefaultApiKey($this->getApiUser(), ['r_users' => AdminAcl::READ]); diff --git a/tests/Integration/Api/Client/AccountControllerTest.php b/tests/Integration/Api/Client/AccountControllerTest.php index 3b221bbde..aaca0da0b 100644 --- a/tests/Integration/Api/Client/AccountControllerTest.php +++ b/tests/Integration/Api/Client/AccountControllerTest.php @@ -12,7 +12,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase /** * Test that the user's account details are returned from the account endpoint. */ - public function testAccountDetailsAreReturned() + public function testAccountDetailsAreReturned(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -36,7 +36,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase /** * Test that the user's email address can be updated via the API. */ - public function testEmailIsUpdated() + public function testEmailIsUpdated(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -55,7 +55,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase * Tests that an email is not updated if the password provided in the request is not * valid for the account. */ - public function testEmailIsNotUpdatedWhenPasswordIsInvalid() + public function testEmailIsNotUpdatedWhenPasswordIsInvalid(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -74,7 +74,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase * Tests that an email is not updated if an invalid email address is passed through * in the request. */ - public function testEmailIsNotUpdatedWhenNotValid() + public function testEmailIsNotUpdatedWhenNotValid(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -101,7 +101,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase /** * Test that the password for an account can be successfully updated. */ - public function testPasswordIsUpdated() + public function testPasswordIsUpdated(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -127,7 +127,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase * Test that the password for an account is not updated if the current password is not * provided correctly. */ - public function testPasswordIsNotUpdatedIfCurrentPasswordIsInvalid() + public function testPasswordIsNotUpdatedIfCurrentPasswordIsInvalid(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -147,7 +147,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase * Test that a validation error is returned to the user if no password is provided or if * the password is below the minimum password length. */ - public function testErrorIsReturnedForInvalidRequestData() + public function testErrorIsReturnedForInvalidRequestData(): void { $user = User::factory()->create(); @@ -170,7 +170,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase * Test that a validation error is returned if the password passed in the request * does not have a confirmation, or the confirmation is not the same as the password. */ - public function testErrorIsReturnedIfPasswordIsNotConfirmed() + public function testErrorIsReturnedIfPasswordIsNotConfirmed(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); diff --git a/tests/Integration/Api/Client/ApiKeyControllerTest.php b/tests/Integration/Api/Client/ApiKeyControllerTest.php index dd0baa8fc..5e380ad36 100644 --- a/tests/Integration/Api/Client/ApiKeyControllerTest.php +++ b/tests/Integration/Api/Client/ApiKeyControllerTest.php @@ -23,7 +23,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase /** * Test that the client's API key can be returned successfully. */ - public function testApiKeysAreReturned() + public function testApiKeysAreReturned(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -47,7 +47,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase * * @dataProvider validIPAddressDataProvider */ - public function testApiKeyCanBeCreatedForAccount(array $data) + public function testApiKeyCanBeCreatedForAccount(array $data): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -79,7 +79,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase /** * Block requests to create an API key specifying more than 50 IP addresses. */ - public function testApiKeyCannotSpecifyMoreThanFiftyIps() + public function testApiKeyCannotSpecifyMoreThanFiftyIps(): void { $ips = []; for ($i = 0; $i < 100; $i++) { @@ -99,7 +99,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase * Test that no more than 25 API keys can exist at any one time for an account. This prevents * a DoS attack vector against the panel. */ - public function testApiKeyLimitIsApplied() + public function testApiKeyLimitIsApplied(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -119,7 +119,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase /** * Test that a bad request results in a validation error being returned by the API. */ - public function testValidationErrorIsReturnedForBadRequests() + public function testValidationErrorIsReturnedForBadRequests(): void { $this->actingAs(User::factory()->create()); @@ -153,7 +153,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase /** * Tests that an API key can be deleted from the account. */ - public function testApiKeyCanBeDeleted() + public function testApiKeyCanBeDeleted(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -172,7 +172,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase /** * Test that trying to delete an API key that does not exist results in a 404. */ - public function testNonExistentApiKeyDeletionReturns404Error() + public function testNonExistentApiKeyDeletionReturns404Error(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -193,7 +193,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase * Test that an API key that exists on the system cannot be deleted if the user * who created it is not the authenticated user. */ - public function testApiKeyBelongingToAnotherUserCannotBeDeleted() + public function testApiKeyBelongingToAnotherUserCannotBeDeleted(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -216,7 +216,7 @@ class ApiKeyControllerTest extends ClientApiIntegrationTestCase * Tests that an application API key also belonging to the logged-in user cannot be * deleted through this endpoint if it exists. */ - public function testApplicationApiKeyCannotBeDeleted() + public function testApplicationApiKeyCannotBeDeleted(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); diff --git a/tests/Integration/Api/Client/ClientControllerTest.php b/tests/Integration/Api/Client/ClientControllerTest.php index d00db70dc..50a150a9d 100644 --- a/tests/Integration/Api/Client/ClientControllerTest.php +++ b/tests/Integration/Api/Client/ClientControllerTest.php @@ -16,7 +16,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase * a subuser, but for this test we just want to test a basic scenario and pretend * subusers do not exist at all. */ - public function testOnlyLoggedInUsersServersAreReturned() + public function testOnlyLoggedInUsersServersAreReturned(): void { /** @var \App\Models\User[] $users */ $users = User::factory()->times(3)->create(); @@ -43,7 +43,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase * Test that using ?filter[*]=name|uuid returns any server matching that name or UUID * with the search filters. */ - public function testServersAreFilteredUsingNameAndUuidInformation() + public function testServersAreFilteredUsingNameAndUuidInformation(): void { /** @var \App\Models\User[] $users */ $users = User::factory()->times(2)->create(); @@ -99,7 +99,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase * Test that using ?filter[*]=:25565 or ?filter[*]=192.168.1.1:25565 returns only those servers * with the same allocation for the given user. */ - public function testServersAreFilteredUsingAllocationInformation() + public function testServersAreFilteredUsingAllocationInformation(): void { /** @var \App\Models\User $user */ /** @var \App\Models\Server $server */ @@ -141,7 +141,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase /** * Test that servers where the user is a subuser are returned by default in the API call. */ - public function testServersUserIsASubuserOfAreReturned() + public function testServersUserIsASubuserOfAreReturned(): void { /** @var \App\Models\User[] $users */ $users = User::factory()->times(3)->create(); @@ -172,7 +172,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase /** * Returns only servers that the user owns, not servers they are a subuser of. */ - public function testFilterOnlyOwnerServers() + public function testFilterOnlyOwnerServers(): void { /** @var \App\Models\User[] $users */ $users = User::factory()->times(3)->create(); @@ -201,7 +201,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase /** * Tests that the permissions from the Panel are returned correctly. */ - public function testPermissionsAreReturned() + public function testPermissionsAreReturned(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -221,7 +221,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase * Test that only servers a user can access because they are an administrator are returned. This * will always exclude any servers they can see because they're the owner or a subuser of the server. */ - public function testOnlyAdminLevelServersAreReturned() + public function testOnlyAdminLevelServersAreReturned(): void { /** @var \App\Models\User[] $users */ $users = User::factory()->times(4)->create(); @@ -256,7 +256,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase /** * Test that all servers a user can access as an admin are returned if using ?filter=admin-all. */ - public function testAllServersAreReturnedToAdmin() + public function testAllServersAreReturnedToAdmin(): void { /** @var \App\Models\User[] $users */ $users = User::factory()->times(4)->create(); @@ -288,7 +288,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase * * @dataProvider filterTypeDataProvider */ - public function testNoServersAreReturnedIfAdminFilterIsPassedByRegularUser(string $type) + public function testNoServersAreReturnedIfAdminFilterIsPassedByRegularUser(string $type): void { /** @var \App\Models\User[] $users */ $users = User::factory()->times(3)->create(); @@ -307,7 +307,7 @@ class ClientControllerTest extends ClientApiIntegrationTestCase * Test that a subuser without the allocation.read permission is only able to see the primary * allocation for the server. */ - public function testOnlyPrimaryAllocationIsReturnedToSubuser() + public function testOnlyPrimaryAllocationIsReturnedToSubuser(): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]); diff --git a/tests/Integration/Api/Client/SSHKeyControllerTest.php b/tests/Integration/Api/Client/SSHKeyControllerTest.php index 92c1b3775..bb8f9676b 100644 --- a/tests/Integration/Api/Client/SSHKeyControllerTest.php +++ b/tests/Integration/Api/Client/SSHKeyControllerTest.php @@ -11,7 +11,7 @@ class SSHKeyControllerTest extends ClientApiIntegrationTestCase /** * Test that only the SSH keys for the authenticated user are returned. */ - public function testSSHKeysAreReturned() + public function testSSHKeysAreReturned(): void { $user = User::factory()->create(); $user2 = User::factory()->create(); @@ -32,7 +32,7 @@ class SSHKeyControllerTest extends ClientApiIntegrationTestCase * Test that a user's SSH key can be deleted, and that passing the fingerprint * of another user's SSH key won't delete that key. */ - public function testSSHKeyCanBeDeleted() + public function testSSHKeyCanBeDeleted(): void { $user = User::factory()->create(); $user2 = User::factory()->create(); @@ -58,7 +58,7 @@ class SSHKeyControllerTest extends ClientApiIntegrationTestCase $this->assertNotSoftDeleted($key2); } - public function testDSAKeyIsRejected() + public function testDSAKeyIsRejected(): void { $user = User::factory()->create(); $key = UserSSHKey::factory()->dsa()->make(); @@ -73,7 +73,7 @@ class SSHKeyControllerTest extends ClientApiIntegrationTestCase $this->assertEquals(0, $user->sshKeys()->count()); } - public function testWeakRSAKeyIsRejected() + public function testWeakRSAKeyIsRejected(): void { $user = User::factory()->create(); $key = UserSSHKey::factory()->rsa(true)->make(); @@ -88,7 +88,7 @@ class SSHKeyControllerTest extends ClientApiIntegrationTestCase $this->assertEquals(0, $user->sshKeys()->count()); } - public function testInvalidOrPrivateKeyIsRejected() + public function testInvalidOrPrivateKeyIsRejected(): void { $user = User::factory()->create(); @@ -110,7 +110,7 @@ class SSHKeyControllerTest extends ClientApiIntegrationTestCase ->assertJsonPath('errors.0.detail', 'The public key provided is not valid.'); } - public function testPublicKeyCanBeStored() + public function testPublicKeyCanBeStored(): void { $user = User::factory()->create(); $key = UserSSHKey::factory()->make(); @@ -127,7 +127,7 @@ class SSHKeyControllerTest extends ClientApiIntegrationTestCase $this->assertEquals($key->public_key, $user->sshKeys[0]->public_key); } - public function testPublicKeyThatAlreadyExistsCannotBeAddedASecondTime() + public function testPublicKeyThatAlreadyExistsCannotBeAddedASecondTime(): void { $user = User::factory()->create(); $key = UserSSHKey::factory()->for($user)->create(); diff --git a/tests/Integration/Api/Client/Server/Allocation/AllocationAuthorizationTest.php b/tests/Integration/Api/Client/Server/Allocation/AllocationAuthorizationTest.php index ba53a10e1..6cd798e16 100644 --- a/tests/Integration/Api/Client/Server/Allocation/AllocationAuthorizationTest.php +++ b/tests/Integration/Api/Client/Server/Allocation/AllocationAuthorizationTest.php @@ -11,7 +11,7 @@ class AllocationAuthorizationTest extends ClientApiIntegrationTestCase /** * @dataProvider methodDataProvider */ - public function testAccessToAServersAllocationsIsRestrictedProperly(string $method, string $endpoint) + public function testAccessToAServersAllocationsIsRestrictedProperly(string $method, string $endpoint): void { // The API $user is the owner of $server1. [$user, $server1] = $this->generateTestAccount(); diff --git a/tests/Integration/Api/Client/Server/Allocation/CreateNewAllocationTest.php b/tests/Integration/Api/Client/Server/Allocation/CreateNewAllocationTest.php index dba285d1b..395e283a2 100644 --- a/tests/Integration/Api/Client/Server/Allocation/CreateNewAllocationTest.php +++ b/tests/Integration/Api/Client/Server/Allocation/CreateNewAllocationTest.php @@ -26,7 +26,7 @@ class CreateNewAllocationTest extends ClientApiIntegrationTestCase * * @dataProvider permissionDataProvider */ - public function testNewAllocationCanBeAssignedToServer(array $permission) + public function testNewAllocationCanBeAssignedToServer(array $permission): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount($permission); @@ -45,7 +45,7 @@ class CreateNewAllocationTest extends ClientApiIntegrationTestCase * Test that a user without the required permissions cannot create an allocation for * the server instance. */ - public function testAllocationCannotBeCreatedIfUserDoesNotHavePermission() + public function testAllocationCannotBeCreatedIfUserDoesNotHavePermission(): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount([Permission::ACTION_ALLOCATION_UPDATE]); @@ -57,7 +57,7 @@ class CreateNewAllocationTest extends ClientApiIntegrationTestCase /** * Test that an error is returned to the user if this feature is not enabled on the system. */ - public function testAllocationCannotBeCreatedIfNotEnabled() + public function testAllocationCannotBeCreatedIfNotEnabled(): void { config()->set('panel.client_features.allocations.enabled', false); @@ -74,7 +74,7 @@ class CreateNewAllocationTest extends ClientApiIntegrationTestCase /** * Test that an allocation cannot be created if the server has reached its allocation limit. */ - public function testAllocationCannotBeCreatedIfServerIsAtLimit() + public function testAllocationCannotBeCreatedIfServerIsAtLimit(): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount(); diff --git a/tests/Integration/Api/Client/Server/Allocation/DeleteAllocationTest.php b/tests/Integration/Api/Client/Server/Allocation/DeleteAllocationTest.php index 83a03579a..07f101a62 100644 --- a/tests/Integration/Api/Client/Server/Allocation/DeleteAllocationTest.php +++ b/tests/Integration/Api/Client/Server/Allocation/DeleteAllocationTest.php @@ -15,7 +15,7 @@ class DeleteAllocationTest extends ClientApiIntegrationTestCase * * @dataProvider permissionDataProvider */ - public function testAllocationCanBeDeletedFromServer(array $permission) + public function testAllocationCanBeDeletedFromServer(array $permission): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount($permission); @@ -36,7 +36,7 @@ class DeleteAllocationTest extends ClientApiIntegrationTestCase /** * Test that an error is returned if the user does not have permissiont to delete an allocation. */ - public function testErrorIsReturnedIfUserDoesNotHavePermission() + public function testErrorIsReturnedIfUserDoesNotHavePermission(): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount([Permission::ACTION_ALLOCATION_CREATE]); @@ -57,7 +57,7 @@ class DeleteAllocationTest extends ClientApiIntegrationTestCase * Test that an allocation is not deleted if it is currently marked as the primary allocation * for the server. */ - public function testErrorIsReturnedIfAllocationIsPrimary() + public function testErrorIsReturnedIfAllocationIsPrimary(): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount(); @@ -69,7 +69,7 @@ class DeleteAllocationTest extends ClientApiIntegrationTestCase ->assertJsonPath('errors.0.detail', 'You cannot delete the primary allocation for this server.'); } - public function testAllocationCannotBeDeletedIfServerLimitIsNotDefined() + public function testAllocationCannotBeDeletedIfServerLimitIsNotDefined(): void { [$user, $server] = $this->generateTestAccount(); @@ -88,7 +88,7 @@ class DeleteAllocationTest extends ClientApiIntegrationTestCase /** * Test that an allocation cannot be deleted if it does not belong to the server instance. */ - public function testErrorIsReturnedIfAllocationDoesNotBelongToServer() + public function testErrorIsReturnedIfAllocationDoesNotBelongToServer(): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount(); diff --git a/tests/Integration/Api/Client/Server/Backup/BackupAuthorizationTest.php b/tests/Integration/Api/Client/Server/Backup/BackupAuthorizationTest.php index e4058d930..472364d78 100644 --- a/tests/Integration/Api/Client/Server/Backup/BackupAuthorizationTest.php +++ b/tests/Integration/Api/Client/Server/Backup/BackupAuthorizationTest.php @@ -13,7 +13,7 @@ class BackupAuthorizationTest extends ClientApiIntegrationTestCase /** * @dataProvider methodDataProvider */ - public function testAccessToAServersBackupIsRestrictedProperly(string $method, string $endpoint) + public function testAccessToAServersBackupIsRestrictedProperly(string $method, string $endpoint): void { // The API $user is the owner of $server1. [$user, $server1] = $this->generateTestAccount(); diff --git a/tests/Integration/Api/Client/Server/Backup/DeleteBackupTest.php b/tests/Integration/Api/Client/Server/Backup/DeleteBackupTest.php index cb37abe2f..2a110228f 100644 --- a/tests/Integration/Api/Client/Server/Backup/DeleteBackupTest.php +++ b/tests/Integration/Api/Client/Server/Backup/DeleteBackupTest.php @@ -22,7 +22,7 @@ class DeleteBackupTest extends ClientApiIntegrationTestCase $this->repository = $this->mock(DaemonBackupRepository::class); } - public function testUserWithoutPermissionCannotDeleteBackup() + public function testUserWithoutPermissionCannotDeleteBackup(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_BACKUP_CREATE]); @@ -37,7 +37,7 @@ class DeleteBackupTest extends ClientApiIntegrationTestCase * in the database. Once deleted there should also be a corresponding record in the * activity logs table for this API call. */ - public function testBackupCanBeDeleted() + public function testBackupCanBeDeleted(): void { Event::fake([ActivityLogged::class]); diff --git a/tests/Integration/Api/Client/Server/CommandControllerTest.php b/tests/Integration/Api/Client/Server/CommandControllerTest.php index 527903d00..36a6425ee 100644 --- a/tests/Integration/Api/Client/Server/CommandControllerTest.php +++ b/tests/Integration/Api/Client/Server/CommandControllerTest.php @@ -17,7 +17,7 @@ class CommandControllerTest extends ClientApiIntegrationTestCase * Test that a validation error is returned if there is no command present in the * request. */ - public function testValidationErrorIsReturnedIfNoCommandIsPresent() + public function testValidationErrorIsReturnedIfNoCommandIsPresent(): void { [$user, $server] = $this->generateTestAccount(); @@ -33,7 +33,7 @@ class CommandControllerTest extends ClientApiIntegrationTestCase * Test that a subuser without the required permission receives an error when trying to * execute the command. */ - public function testSubuserWithoutPermissionReceivesError() + public function testSubuserWithoutPermissionReceivesError(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]); @@ -47,7 +47,7 @@ class CommandControllerTest extends ClientApiIntegrationTestCase /** * Test that a command can be sent to the server. */ - public function testCommandCanSendToServer() + public function testCommandCanSendToServer(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_CONTROL_CONSOLE]); @@ -69,7 +69,7 @@ class CommandControllerTest extends ClientApiIntegrationTestCase * Test that an error is returned when the server is offline that is more specific than the * regular daemon connection error. */ - public function testErrorIsReturnedWhenServerIsOffline() + public function testErrorIsReturnedWhenServerIsOffline(): void { [$user, $server] = $this->generateTestAccount(); diff --git a/tests/Integration/Api/Client/Server/Database/DatabaseAuthorizationTest.php b/tests/Integration/Api/Client/Server/Database/DatabaseAuthorizationTest.php index 603fb54dd..0b3b88cd9 100644 --- a/tests/Integration/Api/Client/Server/Database/DatabaseAuthorizationTest.php +++ b/tests/Integration/Api/Client/Server/Database/DatabaseAuthorizationTest.php @@ -15,7 +15,7 @@ class DatabaseAuthorizationTest extends ClientApiIntegrationTestCase /** * @dataProvider methodDataProvider */ - public function testAccessToAServersDatabasesIsRestrictedProperly(string $method, string $endpoint) + public function testAccessToAServersDatabasesIsRestrictedProperly(string $method, string $endpoint): void { // The API $user is the owner of $server1. [$user, $server1] = $this->generateTestAccount(); diff --git a/tests/Integration/Api/Client/Server/NetworkAllocationControllerTest.php b/tests/Integration/Api/Client/Server/NetworkAllocationControllerTest.php index 260c80bef..b1e7279eb 100644 --- a/tests/Integration/Api/Client/Server/NetworkAllocationControllerTest.php +++ b/tests/Integration/Api/Client/Server/NetworkAllocationControllerTest.php @@ -13,7 +13,7 @@ class NetworkAllocationControllerTest extends ClientApiIntegrationTestCase /** * Test that a servers allocations are returned in the expected format. */ - public function testServerAllocationsAreReturned() + public function testServerAllocationsAreReturned(): void { [$user, $server] = $this->generateTestAccount(); @@ -29,7 +29,7 @@ class NetworkAllocationControllerTest extends ClientApiIntegrationTestCase /** * Test that allocations cannot be returned without the required user permissions. */ - public function testServerAllocationsAreNotReturnedWithoutPermission() + public function testServerAllocationsAreNotReturnedWithoutPermission(): void { [$user, $server] = $this->generateTestAccount(); $user2 = User::factory()->create(); @@ -51,7 +51,7 @@ class NetworkAllocationControllerTest extends ClientApiIntegrationTestCase * * @dataProvider updatePermissionsDataProvider */ - public function testAllocationNotesCanBeUpdated(array $permissions) + public function testAllocationNotesCanBeUpdated(array $permissions): void { [$user, $server] = $this->generateTestAccount($permissions); $allocation = $server->allocation; @@ -81,7 +81,7 @@ class NetworkAllocationControllerTest extends ClientApiIntegrationTestCase $this->assertNull($allocation->notes); } - public function testAllocationNotesCannotBeUpdatedByInvalidUsers() + public function testAllocationNotesCannotBeUpdatedByInvalidUsers(): void { [$user, $server] = $this->generateTestAccount(); $user2 = User::factory()->create(); @@ -99,7 +99,7 @@ class NetworkAllocationControllerTest extends ClientApiIntegrationTestCase /** * @dataProvider updatePermissionsDataProvider */ - public function testPrimaryAllocationCanBeModified(array $permissions) + public function testPrimaryAllocationCanBeModified(array $permissions): void { [$user, $server] = $this->generateTestAccount($permissions); $allocation = $server->allocation; @@ -116,7 +116,7 @@ class NetworkAllocationControllerTest extends ClientApiIntegrationTestCase $this->assertSame($allocation2->id, $server->allocation_id); } - public function testPrimaryAllocationCannotBeModifiedByInvalidUser() + public function testPrimaryAllocationCannotBeModifiedByInvalidUser(): void { [$user, $server] = $this->generateTestAccount(); $user2 = User::factory()->create(); diff --git a/tests/Integration/Api/Client/Server/PowerControllerTest.php b/tests/Integration/Api/Client/Server/PowerControllerTest.php index bc534d867..5cadb3772 100644 --- a/tests/Integration/Api/Client/Server/PowerControllerTest.php +++ b/tests/Integration/Api/Client/Server/PowerControllerTest.php @@ -18,7 +18,7 @@ class PowerControllerTest extends ClientApiIntegrationTestCase * * @dataProvider invalidPermissionDataProvider */ - public function testSubuserWithoutPermissionsReceivesError(string $action, array $permissions) + public function testSubuserWithoutPermissionsReceivesError(string $action, array $permissions): void { [$user, $server] = $this->generateTestAccount($permissions); @@ -30,7 +30,7 @@ class PowerControllerTest extends ClientApiIntegrationTestCase /** * Test that sending an invalid power signal returns an error. */ - public function testInvalidPowerSignalResultsInError() + public function testInvalidPowerSignalResultsInError(): void { [$user, $server] = $this->generateTestAccount(); @@ -48,7 +48,7 @@ class PowerControllerTest extends ClientApiIntegrationTestCase * * @dataProvider validPowerActionDataProvider */ - public function testActionCanBeSentToServer(string $action, string $permission) + public function testActionCanBeSentToServer(string $action, string $permission): void { $service = \Mockery::mock(DaemonPowerRepository::class); $this->app->instance(DaemonPowerRepository::class, $service); diff --git a/tests/Integration/Api/Client/Server/ResourceUtilizationControllerTest.php b/tests/Integration/Api/Client/Server/ResourceUtilizationControllerTest.php index c7ffb62e0..518b7cfb1 100644 --- a/tests/Integration/Api/Client/Server/ResourceUtilizationControllerTest.php +++ b/tests/Integration/Api/Client/Server/ResourceUtilizationControllerTest.php @@ -11,7 +11,7 @@ class ResourceUtilizationControllerTest extends ClientApiIntegrationTestCase /** * Test that the resource utilization for a server is returned in the expected format. */ - public function testServerResourceUtilizationIsReturned() + public function testServerResourceUtilizationIsReturned(): void { $service = \Mockery::mock(DaemonServerRepository::class); $this->app->instance(DaemonServerRepository::class, $service); diff --git a/tests/Integration/Api/Client/Server/Schedule/CreateServerScheduleTest.php b/tests/Integration/Api/Client/Server/Schedule/CreateServerScheduleTest.php index cf8198697..04c2a0ab6 100644 --- a/tests/Integration/Api/Client/Server/Schedule/CreateServerScheduleTest.php +++ b/tests/Integration/Api/Client/Server/Schedule/CreateServerScheduleTest.php @@ -14,7 +14,7 @@ class CreateServerScheduleTest extends ClientApiIntegrationTestCase * * @dataProvider permissionsDataProvider */ - public function testScheduleCanBeCreatedForServer(array $permissions) + public function testScheduleCanBeCreatedForServer(array $permissions): void { [$user, $server] = $this->generateTestAccount($permissions); @@ -50,7 +50,7 @@ class CreateServerScheduleTest extends ClientApiIntegrationTestCase /** * Test that the validation rules for scheduling work as expected. */ - public function testScheduleValidationRules() + public function testScheduleValidationRules(): void { [$user, $server] = $this->generateTestAccount(); @@ -80,7 +80,7 @@ class CreateServerScheduleTest extends ClientApiIntegrationTestCase /** * Test that a subuser without required permissions cannot create a schedule. */ - public function testSubuserCannotCreateScheduleWithoutPermissions() + public function testSubuserCannotCreateScheduleWithoutPermissions(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_SCHEDULE_UPDATE]); diff --git a/tests/Integration/Api/Client/Server/Schedule/DeleteServerScheduleTest.php b/tests/Integration/Api/Client/Server/Schedule/DeleteServerScheduleTest.php index 078bf60d0..b6a4bfa4b 100644 --- a/tests/Integration/Api/Client/Server/Schedule/DeleteServerScheduleTest.php +++ b/tests/Integration/Api/Client/Server/Schedule/DeleteServerScheduleTest.php @@ -15,7 +15,7 @@ class DeleteServerScheduleTest extends ClientApiIntegrationTestCase * * @dataProvider permissionsDataProvider */ - public function testScheduleCanBeDeleted(array $permissions) + public function testScheduleCanBeDeleted(array $permissions): void { [$user, $server] = $this->generateTestAccount($permissions); @@ -33,7 +33,7 @@ class DeleteServerScheduleTest extends ClientApiIntegrationTestCase /** * Test that no error is returned if the schedule does not exist on the system at all. */ - public function testNotFoundErrorIsReturnedIfScheduleDoesNotExistAtAll() + public function testNotFoundErrorIsReturnedIfScheduleDoesNotExistAtAll(): void { [$user, $server] = $this->generateTestAccount(); @@ -46,7 +46,7 @@ class DeleteServerScheduleTest extends ClientApiIntegrationTestCase * Ensure that a schedule belonging to another server cannot be deleted and its presence is not * revealed to the user. */ - public function testNotFoundErrorIsReturnedIfScheduleDoesNotBelongToServer() + public function testNotFoundErrorIsReturnedIfScheduleDoesNotBelongToServer(): void { [$user, $server] = $this->generateTestAccount(); $server2 = $this->createServerModel(['owner_id' => $user->id]); @@ -64,7 +64,7 @@ class DeleteServerScheduleTest extends ClientApiIntegrationTestCase * Test that an error is returned if the subuser does not have the required permissions to * delete the schedule from the server. */ - public function testErrorIsReturnedIfSubuserDoesNotHaveRequiredPermissions() + public function testErrorIsReturnedIfSubuserDoesNotHaveRequiredPermissions(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_SCHEDULE_UPDATE]); diff --git a/tests/Integration/Api/Client/Server/Schedule/ExecuteScheduleTest.php b/tests/Integration/Api/Client/Server/Schedule/ExecuteScheduleTest.php index 992d00286..162a12cdf 100644 --- a/tests/Integration/Api/Client/Server/Schedule/ExecuteScheduleTest.php +++ b/tests/Integration/Api/Client/Server/Schedule/ExecuteScheduleTest.php @@ -17,7 +17,7 @@ class ExecuteScheduleTest extends ClientApiIntegrationTestCase * * @dataProvider permissionsDataProvider */ - public function testScheduleIsExecutedRightAway(array $permissions) + public function testScheduleIsExecutedRightAway(array $permissions): void { [$user, $server] = $this->generateTestAccount($permissions); @@ -54,7 +54,7 @@ class ExecuteScheduleTest extends ClientApiIntegrationTestCase /** * Test that a user without the schedule update permission cannot execute it. */ - public function testUserWithoutScheduleUpdatePermissionCannotExecute() + public function testUserWithoutScheduleUpdatePermissionCannotExecute(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_SCHEDULE_CREATE]); diff --git a/tests/Integration/Api/Client/Server/Schedule/GetServerSchedulesTest.php b/tests/Integration/Api/Client/Server/Schedule/GetServerSchedulesTest.php index 3f8ce52ff..7d019178b 100644 --- a/tests/Integration/Api/Client/Server/Schedule/GetServerSchedulesTest.php +++ b/tests/Integration/Api/Client/Server/Schedule/GetServerSchedulesTest.php @@ -25,7 +25,7 @@ class GetServerSchedulesTest extends ClientApiIntegrationTestCase * * @dataProvider permissionsDataProvider */ - public function testServerSchedulesAreReturned(array $permissions, bool $individual) + public function testServerSchedulesAreReturned(array $permissions, bool $individual): void { [$user, $server] = $this->generateTestAccount($permissions); @@ -59,7 +59,7 @@ class GetServerSchedulesTest extends ClientApiIntegrationTestCase /** * Test that a schedule belonging to another server cannot be viewed. */ - public function testScheduleBelongingToAnotherServerCannotBeViewed() + public function testScheduleBelongingToAnotherServerCannotBeViewed(): void { [$user, $server] = $this->generateTestAccount(); $server2 = $this->createServerModel(['owner_id' => $user->id]); @@ -74,7 +74,7 @@ class GetServerSchedulesTest extends ClientApiIntegrationTestCase /** * Test that a subuser without the required permissions is unable to access the schedules endpoint. */ - public function testUserWithoutPermissionCannotViewSchedules() + public function testUserWithoutPermissionCannotViewSchedules(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]); diff --git a/tests/Integration/Api/Client/Server/Schedule/ScheduleAuthorizationTest.php b/tests/Integration/Api/Client/Server/Schedule/ScheduleAuthorizationTest.php index 044cdfc83..b6777a748 100644 --- a/tests/Integration/Api/Client/Server/Schedule/ScheduleAuthorizationTest.php +++ b/tests/Integration/Api/Client/Server/Schedule/ScheduleAuthorizationTest.php @@ -19,7 +19,7 @@ class ScheduleAuthorizationTest extends ClientApiIntegrationTestCase * * @dataProvider methodDataProvider */ - public function testAccessToAServersSchedulesIsRestrictedProperly(string $method, string $endpoint) + public function testAccessToAServersSchedulesIsRestrictedProperly(string $method, string $endpoint): void { // The API $user is the owner of $server1. [$user, $server1] = $this->generateTestAccount(); diff --git a/tests/Integration/Api/Client/Server/Schedule/UpdateServerScheduleTest.php b/tests/Integration/Api/Client/Server/Schedule/UpdateServerScheduleTest.php index 47bc5b97e..c68d0476a 100644 --- a/tests/Integration/Api/Client/Server/Schedule/UpdateServerScheduleTest.php +++ b/tests/Integration/Api/Client/Server/Schedule/UpdateServerScheduleTest.php @@ -27,7 +27,7 @@ class UpdateServerScheduleTest extends ClientApiIntegrationTestCase * * @dataProvider permissionsDataProvider */ - public function testScheduleCanBeUpdated(array $permissions) + public function testScheduleCanBeUpdated(array $permissions): void { [$user, $server] = $this->generateTestAccount($permissions); @@ -52,7 +52,7 @@ class UpdateServerScheduleTest extends ClientApiIntegrationTestCase * Test that an error is returned if the schedule exists but does not belong to this * specific server instance. */ - public function testErrorIsReturnedIfScheduleDoesNotBelongToServer() + public function testErrorIsReturnedIfScheduleDoesNotBelongToServer(): void { [$user, $server] = $this->generateTestAccount(); $server2 = $this->createServerModel(['owner_id' => $user->id]); @@ -68,7 +68,7 @@ class UpdateServerScheduleTest extends ClientApiIntegrationTestCase * Test that an error is returned if the subuser does not have permission to modify a * server schedule. */ - public function testErrorIsReturnedIfSubuserDoesNotHavePermissionToModifySchedule() + public function testErrorIsReturnedIfSubuserDoesNotHavePermissionToModifySchedule(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_SCHEDULE_CREATE]); @@ -83,7 +83,7 @@ class UpdateServerScheduleTest extends ClientApiIntegrationTestCase * Test that the "is_processing" field gets reset to false when the schedule is enabled * or disabled so that an invalid state can be more easily fixed. */ - public function testScheduleIsProcessingIsSetToFalseWhenActiveStateChanges() + public function testScheduleIsProcessingIsSetToFalseWhenActiveStateChanges(): void { [$user, $server] = $this->generateTestAccount(); diff --git a/tests/Integration/Api/Client/Server/ScheduleTask/CreateServerScheduleTaskTest.php b/tests/Integration/Api/Client/Server/ScheduleTask/CreateServerScheduleTaskTest.php index eef97286e..bdcf33f43 100644 --- a/tests/Integration/Api/Client/Server/ScheduleTask/CreateServerScheduleTaskTest.php +++ b/tests/Integration/Api/Client/Server/ScheduleTask/CreateServerScheduleTaskTest.php @@ -15,7 +15,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase * * @dataProvider permissionsDataProvider */ - public function testTaskCanBeCreated(array $permissions) + public function testTaskCanBeCreated(array $permissions): void { [$user, $server] = $this->generateTestAccount($permissions); @@ -45,7 +45,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase /** * Test that validation errors are returned correctly if bad data is passed into the API. */ - public function testValidationErrorsAreReturned() + public function testValidationErrorsAreReturned(): void { [$user, $server] = $this->generateTestAccount(); @@ -90,7 +90,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase /** * Test that backups can not be tasked when the backup limit is 0. */ - public function testBackupsCanNotBeTaskedIfLimit0() + public function testBackupsCanNotBeTaskedIfLimit0(): void { [$user, $server] = $this->generateTestAccount(); @@ -117,7 +117,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase * Test that an error is returned if the user attempts to create an additional task that * would put the schedule over the task limit. */ - public function testErrorIsReturnedIfTooManyTasksExistForSchedule() + public function testErrorIsReturnedIfTooManyTasksExistForSchedule(): void { config()->set('panel.client_features.schedules.per_schedule_task_limit', 2); @@ -141,7 +141,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase * Test that an error is returned if the targeted schedule does not belong to the server * in the request. */ - public function testErrorIsReturnedIfScheduleDoesNotBelongToServer() + public function testErrorIsReturnedIfScheduleDoesNotBelongToServer(): void { [$user, $server] = $this->generateTestAccount(); $server2 = $this->createServerModel(['owner_id' => $user->id]); @@ -158,7 +158,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase * Test that an error is returned if the subuser making the request does not have permission * to update a schedule. */ - public function testErrorIsReturnedIfSubuserDoesNotHaveScheduleUpdatePermissions() + public function testErrorIsReturnedIfSubuserDoesNotHaveScheduleUpdatePermissions(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_SCHEDULE_CREATE]); diff --git a/tests/Integration/Api/Client/Server/ScheduleTask/DeleteScheduleTaskTest.php b/tests/Integration/Api/Client/Server/ScheduleTask/DeleteScheduleTaskTest.php index 950ac1c5b..b52e21a54 100644 --- a/tests/Integration/Api/Client/Server/ScheduleTask/DeleteScheduleTaskTest.php +++ b/tests/Integration/Api/Client/Server/ScheduleTask/DeleteScheduleTaskTest.php @@ -14,7 +14,7 @@ class DeleteScheduleTaskTest extends ClientApiIntegrationTestCase /** * Test that an error is returned if the schedule does not belong to the server. */ - public function testScheduleNotBelongingToServerReturnsError() + public function testScheduleNotBelongingToServerReturnsError(): void { $server2 = $this->createServerModel(); [$user] = $this->generateTestAccount(); @@ -29,7 +29,7 @@ class DeleteScheduleTaskTest extends ClientApiIntegrationTestCase * Test that an error is returned if the task and schedule in the URL do not line up * with each other. */ - public function testTaskBelongingToDifferentScheduleReturnsError() + public function testTaskBelongingToDifferentScheduleReturnsError(): void { [$user, $server] = $this->generateTestAccount(); @@ -43,7 +43,7 @@ class DeleteScheduleTaskTest extends ClientApiIntegrationTestCase /** * Test that a user without the required permissions returns an error. */ - public function testUserWithoutPermissionReturnsError() + public function testUserWithoutPermissionReturnsError(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_SCHEDULE_CREATE]); @@ -61,7 +61,7 @@ class DeleteScheduleTaskTest extends ClientApiIntegrationTestCase * Test that a schedule task is deleted and items with a higher sequence ID are decremented * properly in the database. */ - public function testScheduleTaskIsDeletedAndSubsequentTasksAreUpdated() + public function testScheduleTaskIsDeletedAndSubsequentTasksAreUpdated(): void { [$user, $server] = $this->generateTestAccount(); diff --git a/tests/Integration/Api/Client/Server/SettingsControllerTest.php b/tests/Integration/Api/Client/Server/SettingsControllerTest.php index bbd57e52d..b40a484c4 100644 --- a/tests/Integration/Api/Client/Server/SettingsControllerTest.php +++ b/tests/Integration/Api/Client/Server/SettingsControllerTest.php @@ -15,7 +15,7 @@ class SettingsControllerTest extends ClientApiIntegrationTestCase * * @dataProvider renamePermissionsDataProvider */ - public function testServerNameCanBeChanged(array $permissions) + public function testServerNameCanBeChanged(array $permissions): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount($permissions); @@ -50,7 +50,7 @@ class SettingsControllerTest extends ClientApiIntegrationTestCase * Test that a subuser receives a permissions error if they do not have the required permission * and attempt to change the name. */ - public function testSubuserCannotChangeServerNameWithoutPermission() + public function testSubuserCannotChangeServerNameWithoutPermission(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]); $originalName = $server->name; @@ -71,7 +71,7 @@ class SettingsControllerTest extends ClientApiIntegrationTestCase * * @dataProvider reinstallPermissionsDataProvider */ - public function testServerCanBeReinstalled(array $permissions) + public function testServerCanBeReinstalled(array $permissions): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount($permissions); @@ -100,7 +100,7 @@ class SettingsControllerTest extends ClientApiIntegrationTestCase * Test that a subuser receives a permissions error if they do not have the required permission * and attempt to reinstall a server. */ - public function testSubuserCannotReinstallServerWithoutPermission() + public function testSubuserCannotReinstallServerWithoutPermission(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]); diff --git a/tests/Integration/Api/Client/Server/Startup/GetStartupAndVariablesTest.php b/tests/Integration/Api/Client/Server/Startup/GetStartupAndVariablesTest.php index 2f20660e8..88cc6ed6f 100644 --- a/tests/Integration/Api/Client/Server/Startup/GetStartupAndVariablesTest.php +++ b/tests/Integration/Api/Client/Server/Startup/GetStartupAndVariablesTest.php @@ -15,7 +15,7 @@ class GetStartupAndVariablesTest extends ClientApiIntegrationTestCase * * @dataProvider permissionsDataProvider */ - public function testStartupVariablesAreReturnedForServer(array $permissions) + public function testStartupVariablesAreReturnedForServer(array $permissions): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount($permissions); @@ -49,7 +49,7 @@ class GetStartupAndVariablesTest extends ClientApiIntegrationTestCase * Test that a user without the required permission, or who does not have any permission to * access the server cannot get the startup information for it. */ - public function testStartupDataIsNotReturnedWithoutPermission() + public function testStartupDataIsNotReturnedWithoutPermission(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]); $this->actingAs($user)->getJson($this->link($server) . '/startup')->assertForbidden(); diff --git a/tests/Integration/Api/Client/Server/Startup/UpdateStartupVariableTest.php b/tests/Integration/Api/Client/Server/Startup/UpdateStartupVariableTest.php index 553fc689a..02d972fe4 100644 --- a/tests/Integration/Api/Client/Server/Startup/UpdateStartupVariableTest.php +++ b/tests/Integration/Api/Client/Server/Startup/UpdateStartupVariableTest.php @@ -15,7 +15,7 @@ class UpdateStartupVariableTest extends ClientApiIntegrationTestCase * * @dataProvider permissionsDataProvider */ - public function testStartupVariableCanBeUpdated(array $permissions) + public function testStartupVariableCanBeUpdated(array $permissions): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount($permissions); @@ -50,7 +50,7 @@ class UpdateStartupVariableTest extends ClientApiIntegrationTestCase * * @dataProvider permissionsDataProvider */ - public function testStartupVariableCannotBeUpdatedIfNotUserViewableOrEditable(array $permissions) + public function testStartupVariableCannotBeUpdatedIfNotUserViewableOrEditable(array $permissions): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount($permissions); @@ -85,7 +85,7 @@ class UpdateStartupVariableTest extends ClientApiIntegrationTestCase * Test that a hidden variable is not included in the startup_command output for the server if * a different variable is updated. */ - public function testHiddenVariablesAreNotReturnedInStartupCommandWhenUpdatingVariable() + public function testHiddenVariablesAreNotReturnedInStartupCommandWhenUpdatingVariable(): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount(); @@ -114,7 +114,7 @@ class UpdateStartupVariableTest extends ClientApiIntegrationTestCase * Test that an egg variable with a validation rule of 'nullable|string' works if no value * is passed through in the request. */ - public function testEggVariableWithNullableStringIsNotRequired() + public function testEggVariableWithNullableStringIsNotRequired(): void { /** @var \App\Models\Server $server */ [$user, $server] = $this->generateTestAccount(); @@ -138,7 +138,7 @@ class UpdateStartupVariableTest extends ClientApiIntegrationTestCase * Test that a variable cannot be updated if the user does not have permission to perform * that action, or they aren't assigned at all to the server. */ - public function testStartupVariableCannotBeUpdatedIfNotUserViewable() + public function testStartupVariableCannotBeUpdatedIfNotUserViewable(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]); $this->actingAs($user)->putJson($this->link($server) . '/startup/variable')->assertForbidden(); diff --git a/tests/Integration/Api/Client/Server/Subuser/CreateServerSubuserTest.php b/tests/Integration/Api/Client/Server/Subuser/CreateServerSubuserTest.php index 55ed7d704..ce382d6ec 100644 --- a/tests/Integration/Api/Client/Server/Subuser/CreateServerSubuserTest.php +++ b/tests/Integration/Api/Client/Server/Subuser/CreateServerSubuserTest.php @@ -19,7 +19,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase * * @dataProvider permissionsDataProvider */ - public function testSubuserCanBeCreated(array $permissions) + public function testSubuserCanBeCreated(array $permissions): void { [$user, $server] = $this->generateTestAccount($permissions); @@ -52,7 +52,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase * Tests that an error is returned if a subuser attempts to create a new subuser and assign * permissions that their account does not also possess. */ - public function testErrorIsReturnedIfAssigningPermissionsNotAssignedToSelf() + public function testErrorIsReturnedIfAssigningPermissionsNotAssignedToSelf(): void { [$user, $server] = $this->generateTestAccount([ Permission::ACTION_USER_CREATE, @@ -76,7 +76,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase /** * Throws some bad data at the API and ensures that a subuser cannot be created. */ - public function testSubuserWithExcessivelyLongEmailCannotBeCreated() + public function testSubuserWithExcessivelyLongEmailCannotBeCreated(): void { [$user, $server] = $this->generateTestAccount(); @@ -107,7 +107,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase * Test that creating a subuser when there is already an account with that email runs * as expected and does not create a new account. */ - public function testCreatingSubuserWithSameEmailAsExistingUserWorks() + public function testCreatingSubuserWithSameEmailAsExistingUserWorks(): void { [$user, $server] = $this->generateTestAccount(); @@ -130,7 +130,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase * Test that an error is returned if the account associated with an email address is already * associated with the server instance. */ - public function testAddingSubuserThatAlreadyIsAssignedReturnsError() + public function testAddingSubuserThatAlreadyIsAssignedReturnsError(): void { [$user, $server] = $this->generateTestAccount(); diff --git a/tests/Integration/Api/Client/Server/Subuser/DeleteSubuserTest.php b/tests/Integration/Api/Client/Server/Subuser/DeleteSubuserTest.php index 7c6b62957..bbd97f4b3 100644 --- a/tests/Integration/Api/Client/Server/Subuser/DeleteSubuserTest.php +++ b/tests/Integration/Api/Client/Server/Subuser/DeleteSubuserTest.php @@ -20,7 +20,7 @@ class DeleteSubuserTest extends ClientApiIntegrationTestCase * it to an integer. Then, in the deep API middlewares you would end up trying to load a user * with an ID of 12, which may or may not exist and be wrongly assigned to the model object. */ - public function testCorrectSubuserIsDeletedFromServer() + public function testCorrectSubuserIsDeletedFromServer(): void { $this->swap(DaemonServerRepository::class, $mock = \Mockery::mock(DaemonServerRepository::class)); diff --git a/tests/Integration/Api/Client/Server/Subuser/SubuserAuthorizationTest.php b/tests/Integration/Api/Client/Server/Subuser/SubuserAuthorizationTest.php index 23f5291fc..ab844d0b3 100644 --- a/tests/Integration/Api/Client/Server/Subuser/SubuserAuthorizationTest.php +++ b/tests/Integration/Api/Client/Server/Subuser/SubuserAuthorizationTest.php @@ -14,7 +14,7 @@ class SubuserAuthorizationTest extends ClientApiIntegrationTestCase * * @dataProvider methodDataProvider */ - public function testUserCannotAccessResourceBelongingToOtherServers(string $method) + public function testUserCannotAccessResourceBelongingToOtherServers(string $method): void { // Generic subuser, the specific resource we're trying to access. /** @var \App\Models\User $internal */ diff --git a/tests/Integration/Api/Client/Server/Subuser/UpdateSubuserTest.php b/tests/Integration/Api/Client/Server/Subuser/UpdateSubuserTest.php index be8d82b04..11ab52201 100644 --- a/tests/Integration/Api/Client/Server/Subuser/UpdateSubuserTest.php +++ b/tests/Integration/Api/Client/Server/Subuser/UpdateSubuserTest.php @@ -13,7 +13,7 @@ class UpdateSubuserTest extends ClientApiIntegrationTestCase * Test that the correct permissions are applied to the account when making updates * to a subusers permissions. */ - public function testCorrectPermissionsAreRequiredForUpdating() + public function testCorrectPermissionsAreRequiredForUpdating(): void { [$user, $server] = $this->generateTestAccount(['user.read']); @@ -53,7 +53,7 @@ class UpdateSubuserTest extends ClientApiIntegrationTestCase * Tests that permissions for the account are updated and any extraneous values * we don't know about are removed. */ - public function testPermissionsAreSavedToAccount() + public function testPermissionsAreSavedToAccount(): void { [$user, $server] = $this->generateTestAccount(); @@ -88,7 +88,7 @@ class UpdateSubuserTest extends ClientApiIntegrationTestCase * Ensure a subuser cannot assign permissions to an account that they do not have * themselves. */ - public function testUserCannotAssignPermissionsTheyDoNotHave() + public function testUserCannotAssignPermissionsTheyDoNotHave(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_USER_READ, Permission::ACTION_USER_UPDATE]); @@ -109,7 +109,7 @@ class UpdateSubuserTest extends ClientApiIntegrationTestCase /** * Test that a user cannot update thyself. */ - public function testUserCannotUpdateSelf() + public function testUserCannotUpdateSelf(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_USER_READ, Permission::ACTION_USER_UPDATE]); @@ -121,7 +121,7 @@ class UpdateSubuserTest extends ClientApiIntegrationTestCase /** * Test that an error is returned if you attempt to update a subuser on a different account. */ - public function testCannotUpdateSubuserForDifferentServer() + public function testCannotUpdateSubuserForDifferentServer(): void { [$user, $server] = $this->generateTestAccount(); [$user2] = $this->generateTestAccount(['foo.bar']); diff --git a/tests/Integration/Api/Client/Server/WebsocketControllerTest.php b/tests/Integration/Api/Client/Server/WebsocketControllerTest.php index 64b7e7af6..6fe802ba1 100644 --- a/tests/Integration/Api/Client/Server/WebsocketControllerTest.php +++ b/tests/Integration/Api/Client/Server/WebsocketControllerTest.php @@ -17,7 +17,7 @@ class WebsocketControllerTest extends ClientApiIntegrationTestCase * Test that a subuser attempting to connect to the websocket receives an error if they * do not explicitly have the permission. */ - public function testSubuserWithoutWebsocketPermissionReceivesError() + public function testSubuserWithoutWebsocketPermissionReceivesError(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_CONTROL_RESTART]); @@ -30,7 +30,7 @@ class WebsocketControllerTest extends ClientApiIntegrationTestCase /** * Confirm users cannot access the websocket for another user's server. */ - public function testUserWithoutPermissionForServerReceivesError() + public function testUserWithoutPermissionForServerReceivesError(): void { [, $server] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]); [$user] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]); @@ -43,7 +43,7 @@ class WebsocketControllerTest extends ClientApiIntegrationTestCase * Test that the expected permissions are returned for the server owner and that the JWT is * configured correctly. */ - public function testJwtAndWebsocketUrlAreReturnedForServerOwner() + public function testJwtAndWebsocketUrlAreReturnedForServerOwner(): void { /** @var \App\Models\User $user */ /** @var \App\Models\Server $server */ @@ -94,7 +94,7 @@ class WebsocketControllerTest extends ClientApiIntegrationTestCase /** * Test that the subuser's permissions are passed along correctly in the generated JWT. */ - public function testJwtIsConfiguredCorrectlyForServerSubuser() + public function testJwtIsConfiguredCorrectlyForServerSubuser(): void { $permissions = [Permission::ACTION_WEBSOCKET_CONNECT, Permission::ACTION_CONTROL_CONSOLE]; diff --git a/tests/Integration/Api/Client/TwoFactorControllerTest.php b/tests/Integration/Api/Client/TwoFactorControllerTest.php index 9bff08121..07fc423f2 100644 --- a/tests/Integration/Api/Client/TwoFactorControllerTest.php +++ b/tests/Integration/Api/Client/TwoFactorControllerTest.php @@ -15,7 +15,7 @@ class TwoFactorControllerTest extends ClientApiIntegrationTestCase * Test that image data for enabling 2FA is returned by the endpoint and that the user * record in the database is updated as expected. */ - public function testTwoFactorImageDataIsReturned() + public function testTwoFactorImageDataIsReturned(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(['use_totp' => false]); @@ -39,7 +39,7 @@ class TwoFactorControllerTest extends ClientApiIntegrationTestCase /** * Test that an error is returned if the user's account already has 2FA enabled on it. */ - public function testErrorIsReturnedWhenTwoFactorIsAlreadyEnabled() + public function testErrorIsReturnedWhenTwoFactorIsAlreadyEnabled(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(['use_totp' => true]); @@ -54,7 +54,7 @@ class TwoFactorControllerTest extends ClientApiIntegrationTestCase /** * Test that a validation error is thrown if invalid data is passed to the 2FA endpoint. */ - public function testValidationErrorIsReturnedIfInvalidDataIsPassedToEnabled2FA() + public function testValidationErrorIsReturnedIfInvalidDataIsPassedToEnabled2FA(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(['use_totp' => false]); @@ -71,7 +71,7 @@ class TwoFactorControllerTest extends ClientApiIntegrationTestCase /** * Tests that 2FA can be enabled on an account for the user. */ - public function testTwoFactorCanBeEnabledOnAccount() + public function testTwoFactorCanBeEnabledOnAccount(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(['use_totp' => false]); @@ -123,7 +123,7 @@ class TwoFactorControllerTest extends ClientApiIntegrationTestCase * Test that two-factor authentication can be disabled on an account as long as the password * provided is valid for the account. */ - public function testTwoFactorCanBeDisabledOnAccount() + public function testTwoFactorCanBeDisabledOnAccount(): void { Carbon::setTestNow(Carbon::now()); @@ -154,7 +154,7 @@ class TwoFactorControllerTest extends ClientApiIntegrationTestCase * Test that no error is returned when trying to disabled two factor on an account where it * was not enabled in the first place. */ - public function testNoErrorIsReturnedIfTwoFactorIsNotEnabled() + public function testNoErrorIsReturnedIfTwoFactorIsNotEnabled(): void { Carbon::setTestNow(Carbon::now()); @@ -171,7 +171,7 @@ class TwoFactorControllerTest extends ClientApiIntegrationTestCase /** * Test that a valid account password is required when enabling two-factor. */ - public function testEnablingTwoFactorRequiresValidPassword() + public function testEnablingTwoFactorRequiresValidPassword(): void { $user = User::factory()->create(['use_totp' => false]); @@ -189,7 +189,7 @@ class TwoFactorControllerTest extends ClientApiIntegrationTestCase /** * Test that a valid account password is required when disabling two-factor. */ - public function testDisablingTwoFactorRequiresValidPassword() + public function testDisablingTwoFactorRequiresValidPassword(): void { $user = User::factory()->create(['use_totp' => true]); diff --git a/tests/Integration/Api/Daemon/DaemonAuthenticateTest.php b/tests/Integration/Api/Daemon/DaemonAuthenticateTest.php index 6dae4c724..a0eabde89 100644 --- a/tests/Integration/Api/Daemon/DaemonAuthenticateTest.php +++ b/tests/Integration/Api/Daemon/DaemonAuthenticateTest.php @@ -16,7 +16,7 @@ class DaemonAuthenticateTest extends MiddlewareTestCase * Test that if we are accessing the daemon configuration route this middleware is not * applied in order to allow an unauthenticated request to use a token to grab data. */ - public function testResponseShouldContinueIfRouteIsExempted() + public function testResponseShouldContinueIfRouteIsExempted(): void { $this->request->expects('route->getName')->withNoArgs()->andReturn('daemon.configuration'); @@ -27,7 +27,7 @@ class DaemonAuthenticateTest extends MiddlewareTestCase * Test that not passing in the bearer token will result in a HTTP/401 error with the * proper response headers. */ - public function testResponseShouldFailIfNoTokenIsProvided() + public function testResponseShouldFailIfNoTokenIsProvided(): void { $this->request->expects('route->getName')->withNoArgs()->andReturn('random.route'); $this->request->expects('bearerToken')->withNoArgs()->andReturnNull(); @@ -48,7 +48,7 @@ class DaemonAuthenticateTest extends MiddlewareTestCase * * @dataProvider badTokenDataProvider */ - public function testResponseShouldFailIfTokenFormatIsIncorrect(string $token) + public function testResponseShouldFailIfTokenFormatIsIncorrect(string $token): void { $this->expectException(BadRequestHttpException::class); @@ -62,7 +62,7 @@ class DaemonAuthenticateTest extends MiddlewareTestCase * Test that an access denied error is returned if the node is valid but the token * provided is not valid. */ - public function testResponseShouldFailIfTokenIsNotValid() + public function testResponseShouldFailIfTokenIsNotValid(): void { $node = Node::factory()->create(); @@ -78,7 +78,7 @@ class DaemonAuthenticateTest extends MiddlewareTestCase * Test that an access denied exception is returned if the node is not found using * the token ID provided. */ - public function testResponseShouldFailIfNodeIsNotFound() + public function testResponseShouldFailIfNodeIsNotFound(): void { $this->expectException(ModelNotFoundException::class); @@ -91,7 +91,7 @@ class DaemonAuthenticateTest extends MiddlewareTestCase /** * Test a successful middleware process. */ - public function testSuccessfulMiddlewareProcess() + public function testSuccessfulMiddlewareProcess(): void { $node = Node::factory()->create(); $node->daemon_token = encrypt('the_same'); diff --git a/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php b/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php index 27c794009..f460ecc50 100644 --- a/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php +++ b/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php @@ -35,7 +35,7 @@ class SftpAuthenticationControllerTest extends IntegrationTestCase /** * Test that a public key is validated correctly. */ - public function testPublicKeyIsValidatedCorrectly() + public function testPublicKeyIsValidatedCorrectly(): void { $key = UserSSHKey::factory()->for($this->user)->create(); @@ -65,7 +65,7 @@ class SftpAuthenticationControllerTest extends IntegrationTestCase /** * Test that an account password is validated correctly. */ - public function testPasswordIsValidatedCorrectly() + public function testPasswordIsValidatedCorrectly(): void { $this->postJson('/api/remote/sftp/auth', [ 'username' => $this->getUsername(), @@ -96,7 +96,7 @@ class SftpAuthenticationControllerTest extends IntegrationTestCase * * @dataProvider authorizationTypeDataProvider */ - public function testUserIsThrottledIfInvalidCredentialsAreProvided() + public function testUserIsThrottledIfInvalidCredentialsAreProvided(): void { for ($i = 0; $i <= 10; $i++) { $this->postJson('/api/remote/sftp/auth', [ @@ -114,7 +114,7 @@ class SftpAuthenticationControllerTest extends IntegrationTestCase * * @dataProvider authorizationTypeDataProvider */ - public function testRequestIsRejectedIfServerBelongsToDifferentNode(string $type) + public function testRequestIsRejectedIfServerBelongsToDifferentNode(string $type): void { $node2 = $this->createServerModel()->node; @@ -132,7 +132,7 @@ class SftpAuthenticationControllerTest extends IntegrationTestCase ->assertForbidden(); } - public function testRequestIsDeniedIfUserLacksSftpPermission() + public function testRequestIsDeniedIfUserLacksSftpPermission(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_FILE_READ]); @@ -151,7 +151,7 @@ class SftpAuthenticationControllerTest extends IntegrationTestCase /** * @dataProvider serverStateDataProvider */ - public function testInvalidServerStateReturnsConflictError(string $status) + public function testInvalidServerStateReturnsConflictError(string $status): void { $this->server->update(['status' => $status]); @@ -162,7 +162,7 @@ class SftpAuthenticationControllerTest extends IntegrationTestCase /** * Test that permissions are returned for the user account correctly. */ - public function testUserPermissionsAreReturnedCorrectly() + public function testUserPermissionsAreReturnedCorrectly(): void { [$user, $server] = $this->generateTestAccount([Permission::ACTION_FILE_READ, Permission::ACTION_FILE_SFTP]); diff --git a/tests/Integration/Http/Controllers/Admin/UserControllerTest.php b/tests/Integration/Http/Controllers/Admin/UserControllerTest.php index 21873cf1a..cbd263501 100644 --- a/tests/Integration/Http/Controllers/Admin/UserControllerTest.php +++ b/tests/Integration/Http/Controllers/Admin/UserControllerTest.php @@ -17,7 +17,7 @@ class UserControllerTest extends IntegrationTestCase * data with the number of servers they are assigned to, and the number of servers they * are a subuser of. */ - public function testIndexReturnsExpectedData() + public function testIndexReturnsExpectedData(): void { $unique = Str::random(); $users = [ diff --git a/tests/Integration/Jobs/Schedule/RunTaskJobTest.php b/tests/Integration/Jobs/Schedule/RunTaskJobTest.php index de20e008e..0db12f7cb 100644 --- a/tests/Integration/Jobs/Schedule/RunTaskJobTest.php +++ b/tests/Integration/Jobs/Schedule/RunTaskJobTest.php @@ -21,7 +21,7 @@ class RunTaskJobTest extends IntegrationTestCase /** * An inactive job should not be run by the system. */ - public function testInactiveJobIsNotRun() + public function testInactiveJobIsNotRun(): void { $server = $this->createServerModel(); @@ -48,7 +48,7 @@ class RunTaskJobTest extends IntegrationTestCase $this->assertTrue(CarbonImmutable::now()->isSameAs(\DateTimeInterface::ATOM, $schedule->last_run_at)); } - public function testJobWithInvalidActionThrowsException() + public function testJobWithInvalidActionThrowsException(): void { $server = $this->createServerModel(); @@ -67,7 +67,7 @@ class RunTaskJobTest extends IntegrationTestCase /** * @dataProvider isManualRunDataProvider */ - public function testJobIsExecuted(bool $isManualRun) + public function testJobIsExecuted(bool $isManualRun): void { $server = $this->createServerModel(); @@ -108,7 +108,7 @@ class RunTaskJobTest extends IntegrationTestCase /** * @dataProvider isManualRunDataProvider */ - public function testExceptionDuringRunIsHandledCorrectly(bool $continueOnFailure) + public function testExceptionDuringRunIsHandledCorrectly(bool $continueOnFailure): void { $server = $this->createServerModel(); @@ -148,7 +148,7 @@ class RunTaskJobTest extends IntegrationTestCase /** * Test that a schedule is not executed if the server is suspended. */ - public function testTaskIsNotRunIfServerIsSuspended() + public function testTaskIsNotRunIfServerIsSuspended(): void { $server = $this->createServerModel([ 'status' => Server::STATUS_SUSPENDED, diff --git a/tests/Integration/Services/Allocations/FindAssignableAllocationServiceTest.php b/tests/Integration/Services/Allocations/FindAssignableAllocationServiceTest.php index a77571c31..382703b03 100644 --- a/tests/Integration/Services/Allocations/FindAssignableAllocationServiceTest.php +++ b/tests/Integration/Services/Allocations/FindAssignableAllocationServiceTest.php @@ -26,7 +26,7 @@ class FindAssignableAllocationServiceTest extends IntegrationTestCase * Test that an unassigned allocation is preferred rather than creating an entirely new * allocation for the server. */ - public function testExistingAllocationIsPreferred() + public function testExistingAllocationIsPreferred(): void { $server = $this->createServerModel(); @@ -47,7 +47,7 @@ class FindAssignableAllocationServiceTest extends IntegrationTestCase /** * Test that a new allocation is created if there is not a free one available. */ - public function testNewAllocationIsCreatedIfOneIsNotFound() + public function testNewAllocationIsCreatedIfOneIsNotFound(): void { $server = $this->createServerModel(); config()->set('panel.client_features.allocations.range_start', 5000); @@ -64,7 +64,7 @@ class FindAssignableAllocationServiceTest extends IntegrationTestCase /** * Test that a currently assigned port is never assigned to a server. */ - public function testOnlyPortNotInUseIsCreated() + public function testOnlyPortNotInUseIsCreated(): void { $server = $this->createServerModel(); $server2 = $this->createServerModel(['node_id' => $server->node_id]); @@ -83,7 +83,7 @@ class FindAssignableAllocationServiceTest extends IntegrationTestCase $this->assertSame(5001, $response->port); } - public function testExceptionIsThrownIfNoMoreAllocationsCanBeCreatedInRange() + public function testExceptionIsThrownIfNoMoreAllocationsCanBeCreatedInRange(): void { $server = $this->createServerModel(); $server2 = $this->createServerModel(['node_id' => $server->node_id]); @@ -109,7 +109,7 @@ class FindAssignableAllocationServiceTest extends IntegrationTestCase * Test that we only auto-allocate from the current server's IP address space, and not a random * IP address available on that node. */ - public function testExceptionIsThrownIfOnlyFreePortIsOnADifferentIp() + public function testExceptionIsThrownIfOnlyFreePortIsOnADifferentIp(): void { $server = $this->createServerModel(); @@ -121,7 +121,7 @@ class FindAssignableAllocationServiceTest extends IntegrationTestCase $this->getService()->handle($server); } - public function testExceptionIsThrownIfStartOrEndRangeIsNotDefined() + public function testExceptionIsThrownIfStartOrEndRangeIsNotDefined(): void { $server = $this->createServerModel(); @@ -131,7 +131,7 @@ class FindAssignableAllocationServiceTest extends IntegrationTestCase $this->getService()->handle($server); } - public function testExceptionIsThrownIfStartOrEndRangeIsNotNumeric() + public function testExceptionIsThrownIfStartOrEndRangeIsNotNumeric(): void { $server = $this->createServerModel(); config()->set('panel.client_features.allocations.range_start', 'hodor'); @@ -157,7 +157,7 @@ class FindAssignableAllocationServiceTest extends IntegrationTestCase } } - public function testExceptionIsThrownIfFeatureIsNotEnabled() + public function testExceptionIsThrownIfFeatureIsNotEnabled(): void { config()->set('panel.client_features.allocations.enabled', false); $server = $this->createServerModel(); diff --git a/tests/Integration/Services/Backups/DeleteBackupServiceTest.php b/tests/Integration/Services/Backups/DeleteBackupServiceTest.php index 648313ef9..ed790e69e 100644 --- a/tests/Integration/Services/Backups/DeleteBackupServiceTest.php +++ b/tests/Integration/Services/Backups/DeleteBackupServiceTest.php @@ -16,7 +16,7 @@ use App\Exceptions\Http\Connection\DaemonConnectionException; class DeleteBackupServiceTest extends IntegrationTestCase { - public function testLockedBackupCannotBeDeleted() + public function testLockedBackupCannotBeDeleted(): void { $server = $this->createServerModel(); $backup = Backup::factory()->create([ @@ -29,7 +29,7 @@ class DeleteBackupServiceTest extends IntegrationTestCase $this->app->make(DeleteBackupService::class)->handle($backup); } - public function testFailedBackupThatIsLockedCanBeDeleted() + public function testFailedBackupThatIsLockedCanBeDeleted(): void { $server = $this->createServerModel(); $backup = Backup::factory()->create([ @@ -48,7 +48,7 @@ class DeleteBackupServiceTest extends IntegrationTestCase $this->assertNotNull($backup->deleted_at); } - public function testExceptionThrownDueToMissingBackupIsIgnored() + public function testExceptionThrownDueToMissingBackupIsIgnored(): void { $server = $this->createServerModel(); $backup = Backup::factory()->create(['server_id' => $server->id]); @@ -67,7 +67,7 @@ class DeleteBackupServiceTest extends IntegrationTestCase $this->assertNotNull($backup->deleted_at); } - public function testExceptionIsThrownIfNot404() + public function testExceptionIsThrownIfNot404(): void { $server = $this->createServerModel(); $backup = Backup::factory()->create(['server_id' => $server->id]); @@ -88,7 +88,7 @@ class DeleteBackupServiceTest extends IntegrationTestCase $this->assertNull($backup->deleted_at); } - public function testS3ObjectCanBeDeleted() + public function testS3ObjectCanBeDeleted(): void { $server = $this->createServerModel(); $backup = Backup::factory()->create([ diff --git a/tests/Integration/Services/Databases/DatabaseManagementServiceTest.php b/tests/Integration/Services/Databases/DatabaseManagementServiceTest.php index 3121b480d..060ed9f10 100644 --- a/tests/Integration/Services/Databases/DatabaseManagementServiceTest.php +++ b/tests/Integration/Services/Databases/DatabaseManagementServiceTest.php @@ -25,7 +25,7 @@ class DatabaseManagementServiceTest extends IntegrationTestCase /** * Test that the name generated by the unique name function is what we expect. */ - public function testUniqueDatabaseNameIsGeneratedCorrectly() + public function testUniqueDatabaseNameIsGeneratedCorrectly(): void { $this->assertSame('s1_example', DatabaseManagementService::generateUniqueDatabaseName('example', 1)); $this->assertSame('s123_something_else', DatabaseManagementService::generateUniqueDatabaseName('something_else', 123)); @@ -35,7 +35,7 @@ class DatabaseManagementServiceTest extends IntegrationTestCase /** * Test that disabling the client database feature flag prevents the creation of databases. */ - public function testExceptionIsThrownIfClientDatabasesAreNotEnabled() + public function testExceptionIsThrownIfClientDatabasesAreNotEnabled(): void { config()->set('panel.client_features.databases.enabled', false); @@ -49,7 +49,7 @@ class DatabaseManagementServiceTest extends IntegrationTestCase * Test that a server at its database limit cannot have an additional one created if * the $validateDatabaseLimit flag is not set to false. */ - public function testDatabaseCannotBeCreatedIfServerHasReachedLimit() + public function testDatabaseCannotBeCreatedIfServerHasReachedLimit(): void { $server = $this->createServerModel(['database_limit' => 2]); $host = DatabaseHost::factory()->create(['node_id' => $server->node_id]); @@ -66,7 +66,7 @@ class DatabaseManagementServiceTest extends IntegrationTestCase * * @dataProvider invalidDataDataProvider */ - public function testEmptyDatabaseNameOrInvalidNameTriggersAnException(array $data) + public function testEmptyDatabaseNameOrInvalidNameTriggersAnException(array $data): void { $server = $this->createServerModel(); @@ -79,7 +79,7 @@ class DatabaseManagementServiceTest extends IntegrationTestCase /** * Test that creating a server database with an identical name triggers an exception. */ - public function testCreatingDatabaseWithIdenticalNameTriggersAnException() + public function testCreatingDatabaseWithIdenticalNameTriggersAnException(): void { $server = $this->createServerModel(); $name = DatabaseManagementService::generateUniqueDatabaseName('something', $server->id); @@ -108,7 +108,7 @@ class DatabaseManagementServiceTest extends IntegrationTestCase /** * Test that a server database can be created successfully. */ - public function testServerDatabaseCanBeCreated() + public function testServerDatabaseCanBeCreated(): void { $this->markTestSkipped(); /* TODO: The exception is because the transaction is closed @@ -142,7 +142,7 @@ class DatabaseManagementServiceTest extends IntegrationTestCase * Test that an exception encountered while creating the database leads to the cleanup code * being called and any exceptions encountered while cleaning up go unreported. */ - public function testExceptionEncounteredWhileCreatingDatabaseAttemptsToCleanup() + public function testExceptionEncounteredWhileCreatingDatabaseAttemptsToCleanup(): void { $this->markTestSkipped(); diff --git a/tests/Integration/Services/Databases/DeployServerDatabaseServiceTest.php b/tests/Integration/Services/Databases/DeployServerDatabaseServiceTest.php index 957ce8052..062dbe07d 100644 --- a/tests/Integration/Services/Databases/DeployServerDatabaseServiceTest.php +++ b/tests/Integration/Services/Databases/DeployServerDatabaseServiceTest.php @@ -44,7 +44,7 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase * * @dataProvider invalidDataProvider */ - public function testErrorIsThrownIfDatabaseNameIsEmpty(array $data) + public function testErrorIsThrownIfDatabaseNameIsEmpty(array $data): void { $server = $this->createServerModel(); @@ -57,7 +57,7 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase * Test that an error is thrown if there are no database hosts on the same node as the * server and the allow_random config value is false. */ - public function testErrorIsThrownIfNoDatabaseHostsExistOnNode() + public function testErrorIsThrownIfNoDatabaseHostsExistOnNode(): void { $server = $this->createServerModel(); @@ -77,7 +77,7 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase /** * Test that an error is thrown if no database hosts exist at all on the system. */ - public function testErrorIsThrownIfNoDatabaseHostsExistOnSystem() + public function testErrorIsThrownIfNoDatabaseHostsExistOnSystem(): void { $server = $this->createServerModel(); @@ -92,7 +92,7 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase /** * Test that a database host on the same node as the server is preferred. */ - public function testDatabaseHostOnSameNodeIsPreferred() + public function testDatabaseHostOnSameNodeIsPreferred(): void { $server = $this->createServerModel(); @@ -119,7 +119,7 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase * there are no same-node hosts and the allow_random configuration value is set to * true. */ - public function testDatabaseHostIsSelectedIfNoSuitableHostExistsOnSameNode() + public function testDatabaseHostIsSelectedIfNoSuitableHostExistsOnSameNode(): void { $server = $this->createServerModel(); diff --git a/tests/Integration/Services/Deployment/FindViableNodesServiceTest.php b/tests/Integration/Services/Deployment/FindViableNodesServiceTest.php index 1cdbfafb3..d9a94cbc9 100644 --- a/tests/Integration/Services/Deployment/FindViableNodesServiceTest.php +++ b/tests/Integration/Services/Deployment/FindViableNodesServiceTest.php @@ -19,7 +19,7 @@ class FindViableNodesServiceTest extends IntegrationTestCase Node::query()->delete(); } - public function testExceptionIsThrownIfNoDiskSpaceHasBeenSet() + public function testExceptionIsThrownIfNoDiskSpaceHasBeenSet(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Disk space must be an int, got NULL'); @@ -27,7 +27,7 @@ class FindViableNodesServiceTest extends IntegrationTestCase $this->getService()->handle(); } - public function testExceptionIsThrownIfNoMemoryHasBeenSet() + public function testExceptionIsThrownIfNoMemoryHasBeenSet(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Memory usage must be an int, got NULL'); diff --git a/tests/Integration/Services/Schedules/ProcessScheduleServiceTest.php b/tests/Integration/Services/Schedules/ProcessScheduleServiceTest.php index 3ded1ae9f..43aef5cca 100644 --- a/tests/Integration/Services/Schedules/ProcessScheduleServiceTest.php +++ b/tests/Integration/Services/Schedules/ProcessScheduleServiceTest.php @@ -18,7 +18,7 @@ class ProcessScheduleServiceTest extends IntegrationTestCase /** * Test that a schedule with no tasks registered returns an error. */ - public function testScheduleWithNoTasksReturnsException() + public function testScheduleWithNoTasksReturnsException(): void { $server = $this->createServerModel(); $schedule = Schedule::factory()->create(['server_id' => $server->id]); @@ -32,7 +32,7 @@ class ProcessScheduleServiceTest extends IntegrationTestCase /** * Test that an error during the schedule update is not persisted to the database. */ - public function testErrorDuringScheduleDataUpdateDoesNotPersistChanges() + public function testErrorDuringScheduleDataUpdateDoesNotPersistChanges(): void { $server = $this->createServerModel(); @@ -58,7 +58,7 @@ class ProcessScheduleServiceTest extends IntegrationTestCase * * @dataProvider dispatchNowDataProvider */ - public function testJobCanBeDispatchedWithExpectedInitialDelay(bool $now) + public function testJobCanBeDispatchedWithExpectedInitialDelay(bool $now): void { Bus::fake(); @@ -89,7 +89,7 @@ class ProcessScheduleServiceTest extends IntegrationTestCase * Test that even if a schedule's task sequence gets messed up the first task based on * the ascending order of tasks is used. */ - public function testFirstSequenceTaskIsFound() + public function testFirstSequenceTaskIsFound(): void { Bus::fake(); @@ -118,7 +118,7 @@ class ProcessScheduleServiceTest extends IntegrationTestCase * Tests that a task's processing state is reset correctly if using "dispatchNow" and there is * an exception encountered while running it. */ - public function testTaskDispatchedNowIsResetProperlyIfErrorIsEncountered() + public function testTaskDispatchedNowIsResetProperlyIfErrorIsEncountered(): void { $this->swap(Dispatcher::class, $dispatcher = \Mockery::mock(Dispatcher::class)); diff --git a/tests/Integration/Services/Servers/BuildModificationServiceTest.php b/tests/Integration/Services/Servers/BuildModificationServiceTest.php index 3a749ae57..15faf4102 100644 --- a/tests/Integration/Services/Servers/BuildModificationServiceTest.php +++ b/tests/Integration/Services/Servers/BuildModificationServiceTest.php @@ -32,7 +32,7 @@ class BuildModificationServiceTest extends IntegrationTestCase * Test that allocations can be added and removed from a server. Only the allocations on the * current node and belonging to this server should be modified. */ - public function testAllocationsCanBeModifiedForTheServer() + public function testAllocationsCanBeModifiedForTheServer(): void { $server = $this->createServerModel(); $server2 = $this->createServerModel(); @@ -81,7 +81,7 @@ class BuildModificationServiceTest extends IntegrationTestCase * Test that an exception is thrown if removing the default allocation without also assigning * new allocations to the server. */ - public function testExceptionIsThrownIfRemovingTheDefaultAllocation() + public function testExceptionIsThrownIfRemovingTheDefaultAllocation(): void { $server = $this->createServerModel(); /** @var \App\Models\Allocation[] $allocations */ @@ -103,7 +103,7 @@ class BuildModificationServiceTest extends IntegrationTestCase * the server data is updated in realtime. This test also ensures that only certain fields get updated * for the server, and not just any arbitrary field. */ - public function testServerBuildDataIsProperlyUpdatedOndaemon() + public function testServerBuildDataIsProperlyUpdatedOndaemon(): void { $server = $this->createServerModel(); @@ -143,7 +143,7 @@ class BuildModificationServiceTest extends IntegrationTestCase * when making updates. This allows for a server to be modified even when the Daemon * node is offline. */ - public function testConnectionExceptionIsIgnoredWhenUpdatingServerSettings() + public function testConnectionExceptionIsIgnoredWhenUpdatingServerSettings(): void { $server = $this->createServerModel(); @@ -165,7 +165,7 @@ class BuildModificationServiceTest extends IntegrationTestCase /** * Test that no exception is thrown if we are only removing an allocation. */ - public function testNoExceptionIsThrownIfOnlyRemovingAllocation() + public function testNoExceptionIsThrownIfOnlyRemovingAllocation(): void { $server = $this->createServerModel(); /** @var \App\Models\Allocation $allocation */ @@ -188,7 +188,7 @@ class BuildModificationServiceTest extends IntegrationTestCase * * We'll default to adding the allocation in this case. */ - public function testAllocationInBothAddAndRemoveIsAdded() + public function testAllocationInBothAddAndRemoveIsAdded(): void { $server = $this->createServerModel(); /** @var \App\Models\Allocation $allocation */ @@ -207,7 +207,7 @@ class BuildModificationServiceTest extends IntegrationTestCase /** * Test that using the same allocation ID multiple times in the array does not cause an error. */ - public function testUsingSameAllocationIdMultipleTimesDoesNotError() + public function testUsingSameAllocationIdMultipleTimesDoesNotError(): void { $server = $this->createServerModel(); /** @var \App\Models\Allocation $allocation */ @@ -232,7 +232,7 @@ class BuildModificationServiceTest extends IntegrationTestCase * test which should properly ignore connection issues. We want any other type of exception * to properly be thrown back to the caller. */ - public function testThatUpdatesAreRolledBackIfExceptionIsEncountered() + public function testThatUpdatesAreRolledBackIfExceptionIsEncountered(): void { $server = $this->createServerModel(); /** @var \App\Models\Allocation $allocation */ diff --git a/tests/Integration/Services/Servers/ServerCreationServiceTest.php b/tests/Integration/Services/Servers/ServerCreationServiceTest.php index cad91cada..2f974aa5e 100644 --- a/tests/Integration/Services/Servers/ServerCreationServiceTest.php +++ b/tests/Integration/Services/Servers/ServerCreationServiceTest.php @@ -51,7 +51,7 @@ class ServerCreationServiceTest extends IntegrationTestCase * tests to cover that the logic being used does indeed find suitable nodes and ports. For * this test we just care that it is recognized and passed off to those functions. */ - public function testServerIsCreatedWithDeploymentObject() + public function testServerIsCreatedWithDeploymentObject(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); @@ -148,7 +148,7 @@ class ServerCreationServiceTest extends IntegrationTestCase * Test that a server is deleted from the Panel if daemon returns an error during the creation * process. */ - public function testErrorEncounteredByDaemonCausesServerToBeDeleted() + public function testErrorEncounteredByDaemonCausesServerToBeDeleted(): void { /** @var \App\Models\User $user */ $user = User::factory()->create(); diff --git a/tests/Integration/Services/Servers/ServerDeletionServiceTest.php b/tests/Integration/Services/Servers/ServerDeletionServiceTest.php index 156b6f375..ffad1b230 100644 --- a/tests/Integration/Services/Servers/ServerDeletionServiceTest.php +++ b/tests/Integration/Services/Servers/ServerDeletionServiceTest.php @@ -55,7 +55,7 @@ class ServerDeletionServiceTest extends IntegrationTestCase * Test that a server is not deleted if the force option is not set and an error * is returned by daemon. */ - public function testRegularDeleteFailsIfDaemonReturnsError() + public function testRegularDeleteFailsIfDaemonReturnsError(): void { $server = $this->createServerModel(); @@ -73,7 +73,7 @@ class ServerDeletionServiceTest extends IntegrationTestCase /** * Test that a 404 from Daemon while deleting a server does not cause the deletion to fail. */ - public function testRegularDeleteIgnores404FromDaemon() + public function testRegularDeleteIgnores404FromDaemon(): void { $server = $this->createServerModel(); @@ -90,7 +90,7 @@ class ServerDeletionServiceTest extends IntegrationTestCase * Test that an error from Daemon does not cause the deletion to fail if the server is being * force deleted. */ - public function testForceDeleteIgnoresExceptionFromDaemon() + public function testForceDeleteIgnoresExceptionFromDaemon(): void { $server = $this->createServerModel(); @@ -107,7 +107,7 @@ class ServerDeletionServiceTest extends IntegrationTestCase * Test that a non-force-delete call does not delete the server if one of the databases * cannot be deleted from the host. */ - public function testExceptionWhileDeletingStopsProcess() + public function testExceptionWhileDeletingStopsProcess(): void { $server = $this->createServerModel(); $host = DatabaseHost::factory()->create(); @@ -132,7 +132,7 @@ class ServerDeletionServiceTest extends IntegrationTestCase /** * Test that a server is deleted even if the server databases cannot be deleted from the host. */ - public function testExceptionWhileDeletingDatabasesDoesNotAbortIfForceDeleted() + public function testExceptionWhileDeletingDatabasesDoesNotAbortIfForceDeleted(): void { $server = $this->createServerModel(); $host = DatabaseHost::factory()->create(); diff --git a/tests/Integration/Services/Servers/StartupModificationServiceTest.php b/tests/Integration/Services/Servers/StartupModificationServiceTest.php index 77802b5aa..f0d2726e1 100644 --- a/tests/Integration/Services/Servers/StartupModificationServiceTest.php +++ b/tests/Integration/Services/Servers/StartupModificationServiceTest.php @@ -19,7 +19,7 @@ class StartupModificationServiceTest extends IntegrationTestCase * egg_id variable which should have no impact if the request is coming from * a non-admin entity. */ - public function testNonAdminCanModifyServerVariables() + public function testNonAdminCanModifyServerVariables(): void { $server = $this->createServerModel(); @@ -67,7 +67,7 @@ class StartupModificationServiceTest extends IntegrationTestCase /** * Test that modifying an egg as an admin properly updates the data for the server. */ - public function testServerIsProperlyModifiedAsAdminUser() + public function testServerIsProperlyModifiedAsAdminUser(): void { /** @var \App\Models\Egg $nextEgg */ $nextEgg = Egg::query()->findOrFail(6); @@ -99,7 +99,7 @@ class StartupModificationServiceTest extends IntegrationTestCase * Test that hidden variables can be updated by an admin but are not affected by a * regular user who attempts to pass them through. */ - public function testEnvironmentVariablesCanBeUpdatedByAdmin() + public function testEnvironmentVariablesCanBeUpdatedByAdmin(): void { $server = $this->createServerModel(); $server->loadMissing(['egg', 'variables']); @@ -147,7 +147,7 @@ class StartupModificationServiceTest extends IntegrationTestCase * Test that passing an invalid egg ID into the function throws an exception * rather than silently failing or skipping. */ - public function testInvalidEggIdTriggersException() + public function testInvalidEggIdTriggersException(): void { $server = $this->createServerModel(); diff --git a/tests/Integration/Services/Servers/SuspensionServiceTest.php b/tests/Integration/Services/Servers/SuspensionServiceTest.php index 4883b863b..423e2534f 100644 --- a/tests/Integration/Services/Servers/SuspensionServiceTest.php +++ b/tests/Integration/Services/Servers/SuspensionServiceTest.php @@ -23,7 +23,7 @@ class SuspensionServiceTest extends IntegrationTestCase $this->app->instance(DaemonServerRepository::class, $this->repository); } - public function testServerIsSuspendedAndUnsuspended() + public function testServerIsSuspendedAndUnsuspended(): void { $server = $this->createServerModel(); @@ -38,7 +38,7 @@ class SuspensionServiceTest extends IntegrationTestCase $this->assertFalse($server->refresh()->isSuspended()); } - public function testNoActionIsTakenIfSuspensionStatusIsUnchanged() + public function testNoActionIsTakenIfSuspensionStatusIsUnchanged(): void { $server = $this->createServerModel(); @@ -54,7 +54,7 @@ class SuspensionServiceTest extends IntegrationTestCase $this->assertTrue($server->isSuspended()); } - public function testExceptionIsThrownIfInvalidActionsArePassed() + public function testExceptionIsThrownIfInvalidActionsArePassed(): void { $server = $this->createServerModel(); diff --git a/tests/Integration/Services/Servers/VariableValidatorServiceTest.php b/tests/Integration/Services/Servers/VariableValidatorServiceTest.php index dbe145c7d..113e29762 100644 --- a/tests/Integration/Services/Servers/VariableValidatorServiceTest.php +++ b/tests/Integration/Services/Servers/VariableValidatorServiceTest.php @@ -27,7 +27,7 @@ class VariableValidatorServiceTest extends IntegrationTestCase /** * Test that environment variables for a server are validated as expected. */ - public function testEnvironmentVariablesCanBeValidated() + public function testEnvironmentVariablesCanBeValidated(): void { $egg = $this->cloneEggAndVariables($this->egg); @@ -64,7 +64,7 @@ class VariableValidatorServiceTest extends IntegrationTestCase * Test that variables that are user_editable=false do not get validated (or returned) by * the handler. */ - public function testNormalUserCannotValidateNonUserEditableVariables() + public function testNormalUserCannotValidateNonUserEditableVariables(): void { $egg = $this->cloneEggAndVariables($this->egg); $egg->variables()->first()->update([ @@ -83,7 +83,7 @@ class VariableValidatorServiceTest extends IntegrationTestCase $this->assertSame('server.jar', $response->get(0)->value); } - public function testEnvironmentVariablesCanBeUpdatedAsAdmin() + public function testEnvironmentVariablesCanBeUpdatedAsAdmin(): void { $egg = $this->cloneEggAndVariables($this->egg); $egg->variables()->first()->update([ @@ -115,7 +115,7 @@ class VariableValidatorServiceTest extends IntegrationTestCase $this->assertSame('server.jar', $response->get(1)->value); } - public function testNullableEnvironmentVariablesCanBeUsedCorrectly() + public function testNullableEnvironmentVariablesCanBeUsedCorrectly(): void { $egg = $this->cloneEggAndVariables($this->egg); $egg->variables()->where('env_variable', '!=', 'BUNGEE_VERSION')->delete(); diff --git a/tests/Unit/Helpers/EnvironmentWriterTraitTest.php b/tests/Unit/Helpers/EnvironmentWriterTraitTest.php index 1cfa30d0c..d73681b39 100644 --- a/tests/Unit/Helpers/EnvironmentWriterTraitTest.php +++ b/tests/Unit/Helpers/EnvironmentWriterTraitTest.php @@ -10,7 +10,7 @@ class EnvironmentWriterTraitTest extends TestCase /** * @dataProvider variableDataProvider */ - public function testVariableIsEscapedProperly($input, $expected) + public function testVariableIsEscapedProperly($input, $expected): void { $output = (new FooClass())->escapeEnvironmentValue($input); diff --git a/tests/Unit/Helpers/IsDigitTest.php b/tests/Unit/Helpers/IsDigitTest.php index e752625c1..fa3c2e090 100644 --- a/tests/Unit/Helpers/IsDigitTest.php +++ b/tests/Unit/Helpers/IsDigitTest.php @@ -11,7 +11,7 @@ class IsDigitTest extends TestCase * * @dataProvider helperDataProvider */ - public function testHelper($value, $response) + public function testHelper($value, $response): void { $this->assertSame($response, is_digit($value)); } diff --git a/tests/Unit/Http/Middleware/AdminAuthenticateTest.php b/tests/Unit/Http/Middleware/AdminAuthenticateTest.php index 5e9c72350..87f647819 100644 --- a/tests/Unit/Http/Middleware/AdminAuthenticateTest.php +++ b/tests/Unit/Http/Middleware/AdminAuthenticateTest.php @@ -11,7 +11,7 @@ class AdminAuthenticateTest extends MiddlewareTestCase /** * Test that an admin is authenticated. */ - public function testAdminsAreAuthenticated() + public function testAdminsAreAuthenticated(): void { $user = User::factory()->make(['root_admin' => 1]); @@ -23,7 +23,7 @@ class AdminAuthenticateTest extends MiddlewareTestCase /** * Test that a missing user in the request triggers an error. */ - public function testExceptionIsThrownIfUserDoesNotExist() + public function testExceptionIsThrownIfUserDoesNotExist(): void { $this->expectException(AccessDeniedHttpException::class); @@ -35,7 +35,7 @@ class AdminAuthenticateTest extends MiddlewareTestCase /** * Test that an exception is thrown if the user is not an admin. */ - public function testExceptionIsThrownIfUserIsNotAnAdmin() + public function testExceptionIsThrownIfUserIsNotAnAdmin(): void { $this->expectException(AccessDeniedHttpException::class); diff --git a/tests/Unit/Http/Middleware/Api/Application/AuthenticateUserTest.php b/tests/Unit/Http/Middleware/Api/Application/AuthenticateUserTest.php index 2231994ec..bfaf4cd75 100644 --- a/tests/Unit/Http/Middleware/Api/Application/AuthenticateUserTest.php +++ b/tests/Unit/Http/Middleware/Api/Application/AuthenticateUserTest.php @@ -11,7 +11,7 @@ class AuthenticateUserTest extends MiddlewareTestCase /** * Test that no user defined results in an access denied exception. */ - public function testNoUserDefined() + public function testNoUserDefined(): void { $this->expectException(AccessDeniedHttpException::class); @@ -23,7 +23,7 @@ class AuthenticateUserTest extends MiddlewareTestCase /** * Test that a non-admin user results in an exception. */ - public function testNonAdminUser() + public function testNonAdminUser(): void { $this->expectException(AccessDeniedHttpException::class); @@ -35,7 +35,7 @@ class AuthenticateUserTest extends MiddlewareTestCase /** * Test that an admin user continues though the middleware. */ - public function testAdminUser() + public function testAdminUser(): void { $this->generateRequestUserModel(['root_admin' => true]); diff --git a/tests/Unit/Http/Middleware/LanguageMiddlewareTest.php b/tests/Unit/Http/Middleware/LanguageMiddlewareTest.php index a2be13184..38dc6a4d0 100644 --- a/tests/Unit/Http/Middleware/LanguageMiddlewareTest.php +++ b/tests/Unit/Http/Middleware/LanguageMiddlewareTest.php @@ -25,7 +25,7 @@ class LanguageMiddlewareTest extends MiddlewareTestCase /** * Test that a language is defined via the middleware for guests. */ - public function testLanguageIsSetForGuest() + public function testLanguageIsSetForGuest(): void { $this->request->shouldReceive('user')->withNoArgs()->andReturnNull(); $this->appMock->shouldReceive('setLocale')->with('en')->once()->andReturnNull(); @@ -36,7 +36,7 @@ class LanguageMiddlewareTest extends MiddlewareTestCase /** * Test that a language is defined via the middleware for a user. */ - public function testLanguageIsSetWithAuthenticatedUser() + public function testLanguageIsSetWithAuthenticatedUser(): void { $user = User::factory()->make(['language' => 'de']); diff --git a/tests/Unit/Http/Middleware/MaintenanceMiddlewareTest.php b/tests/Unit/Http/Middleware/MaintenanceMiddlewareTest.php index d0991de15..abdcab33c 100644 --- a/tests/Unit/Http/Middleware/MaintenanceMiddlewareTest.php +++ b/tests/Unit/Http/Middleware/MaintenanceMiddlewareTest.php @@ -27,7 +27,7 @@ class MaintenanceMiddlewareTest extends MiddlewareTestCase /** * Test that a node not in maintenance mode continues through the request cycle. */ - public function testHandle() + public function testHandle(): void { $server = Server::factory()->make(); $node = Node::factory()->make(['maintenance' => 0]); @@ -41,7 +41,7 @@ class MaintenanceMiddlewareTest extends MiddlewareTestCase /** * Test that a node in maintenance mode returns an error view. */ - public function testHandleInMaintenanceMode() + public function testHandleInMaintenanceMode(): void { $server = Server::factory()->make(); $node = Node::factory()->make(['maintenance_mode' => 1]); diff --git a/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php b/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php index 6d0bd5362..8b7c6342e 100644 --- a/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php +++ b/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php @@ -25,7 +25,7 @@ class RedirectIfAuthenticatedTest extends MiddlewareTestCase /** * Test that an authenticated user is redirected. */ - public function testAuthenticatedUserIsRedirected() + public function testAuthenticatedUserIsRedirected(): void { $this->authManager->shouldReceive('guard')->with(null)->once()->andReturnSelf(); $this->authManager->shouldReceive('check')->withNoArgs()->once()->andReturn(true); @@ -38,7 +38,7 @@ class RedirectIfAuthenticatedTest extends MiddlewareTestCase /** * Test that a non-authenticated user continues through the middleware. */ - public function testNonAuthenticatedUserIsNotRedirected() + public function testNonAuthenticatedUserIsNotRedirected(): void { $this->authManager->shouldReceive('guard')->with(null)->once()->andReturnSelf(); $this->authManager->shouldReceive('check')->withNoArgs()->once()->andReturn(false); diff --git a/tests/Unit/Rules/UsernameTest.php b/tests/Unit/Rules/UsernameTest.php index 634d0dc02..fc475e3cf 100644 --- a/tests/Unit/Rules/UsernameTest.php +++ b/tests/Unit/Rules/UsernameTest.php @@ -10,7 +10,7 @@ class UsernameTest extends TestCase /** * Test that this rule can be cast to a string correctly. */ - public function testRuleIsStringable() + public function testRuleIsStringable(): void { $this->assertSame('p_username', (string) new Username()); } @@ -20,7 +20,7 @@ class UsernameTest extends TestCase * * @dataProvider validUsernameDataProvider */ - public function testValidUsernames(string $username) + public function testValidUsernames(string $username): void { $this->assertTrue((new Username())->passes('test', $username), 'Assert username is valid.'); } @@ -30,7 +30,7 @@ class UsernameTest extends TestCase * * @dataProvider invalidUsernameDataProvider */ - public function testInvalidUsernames(string $username) + public function testInvalidUsernames(string $username): void { $this->assertFalse((new Username())->passes('test', $username), 'Assert username is not valid.'); } diff --git a/tests/Unit/Services/Acl/Api/AdminAclTest.php b/tests/Unit/Services/Acl/Api/AdminAclTest.php index 2ebaa3068..8254457a1 100644 --- a/tests/Unit/Services/Acl/Api/AdminAclTest.php +++ b/tests/Unit/Services/Acl/Api/AdminAclTest.php @@ -13,7 +13,7 @@ class AdminAclTest extends TestCase * * @dataProvider permissionsDataProvider */ - public function testPermissions(int $permission, int $check, bool $outcome) + public function testPermissions(int $permission, int $check, bool $outcome): void { $this->assertSame($outcome, AdminAcl::can($permission, $check)); } @@ -21,7 +21,7 @@ class AdminAclTest extends TestCase /** * Test that checking against a model works as expected. */ - public function testCheck() + public function testCheck(): void { $model = ApiKey::factory()->make(['r_servers' => AdminAcl::READ | AdminAcl::WRITE]);