From 2ed3763d21f2b47f2d88a72a92129edb27b09f53 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 28 Jun 2020 15:43:44 -0700 Subject: [PATCH] cs fix --- .github/workflows/tests.yml | 1 + .../Commands/Migration/CleanOrphanedApiKeysCommand.php | 2 +- app/Contracts/Repository/SessionRepositoryInterface.php | 2 +- app/Contracts/Repository/TaskRepositoryInterface.php | 2 +- app/Http/Requests/Api/Application/Nodes/StoreNodeRequest.php | 2 +- app/Repositories/Concerns/Searchable.php | 2 +- app/Repositories/Eloquent/DatabaseRepository.php | 2 +- app/Repositories/Eloquent/SessionRepository.php | 2 +- app/Repositories/Eloquent/TaskRepository.php | 2 +- app/Services/Helpers/AssetHashService.php | 2 +- bootstrap/tests.php | 2 +- config/logging.php | 2 -- .../2017_07_24_194433_DeleteTaskWhenParentServerIsDeleted.php | 1 - .../2020_04_17_203438_allow_nullable_descriptions.php | 4 ++-- .../2020_04_22_055500_add_max_connections_column.php | 4 ++-- .../2020_04_26_111208_add_backup_limit_to_servers.php | 4 ++-- database/seeds/EggSeeder.php | 1 + 17 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a28a2d7e..71328ff0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,6 +4,7 @@ on: pull_request: jobs: integration_tests: + if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')" runs-on: ubuntu-latest services: mysql: diff --git a/app/Console/Commands/Migration/CleanOrphanedApiKeysCommand.php b/app/Console/Commands/Migration/CleanOrphanedApiKeysCommand.php index b9e007ee..e7d86399 100644 --- a/app/Console/Commands/Migration/CleanOrphanedApiKeysCommand.php +++ b/app/Console/Commands/Migration/CleanOrphanedApiKeysCommand.php @@ -38,7 +38,7 @@ class CleanOrphanedApiKeysCommand extends Command /** * Delete all orphaned API keys from the database when upgrading from 0.6 to 0.7. * - * @return null|void + * @return void|null */ public function handle() { diff --git a/app/Contracts/Repository/SessionRepositoryInterface.php b/app/Contracts/Repository/SessionRepositoryInterface.php index 496fa35e..e1dafed1 100644 --- a/app/Contracts/Repository/SessionRepositoryInterface.php +++ b/app/Contracts/Repository/SessionRepositoryInterface.php @@ -19,7 +19,7 @@ interface SessionRepositoryInterface extends RepositoryInterface * * @param int $user * @param string $session - * @return null|int + * @return int|null */ public function deleteUserSession(int $user, string $session); } diff --git a/app/Contracts/Repository/TaskRepositoryInterface.php b/app/Contracts/Repository/TaskRepositoryInterface.php index 11cb704e..ea948625 100644 --- a/app/Contracts/Repository/TaskRepositoryInterface.php +++ b/app/Contracts/Repository/TaskRepositoryInterface.php @@ -21,7 +21,7 @@ interface TaskRepositoryInterface extends RepositoryInterface * * @param int $schedule * @param int $index - * @return null|\Pterodactyl\Models\Task + * @return \Pterodactyl\Models\Task|null */ public function getNextTask(int $schedule, int $index); } diff --git a/app/Http/Requests/Api/Application/Nodes/StoreNodeRequest.php b/app/Http/Requests/Api/Application/Nodes/StoreNodeRequest.php index 3ae474ba..8e23db43 100644 --- a/app/Http/Requests/Api/Application/Nodes/StoreNodeRequest.php +++ b/app/Http/Requests/Api/Application/Nodes/StoreNodeRequest.php @@ -21,7 +21,7 @@ class StoreNodeRequest extends ApplicationApiRequest /** * Validation rules to apply to this request. * - * @param null|array $rules + * @param array|null $rules * @return array */ public function rules(array $rules = null): array diff --git a/app/Repositories/Concerns/Searchable.php b/app/Repositories/Concerns/Searchable.php index 26ed6544..8bb11a55 100644 --- a/app/Repositories/Concerns/Searchable.php +++ b/app/Repositories/Concerns/Searchable.php @@ -7,7 +7,7 @@ trait Searchable /** * The search term to use when filtering results. * - * @var null|string + * @var string|null */ protected $searchTerm; diff --git a/app/Repositories/Eloquent/DatabaseRepository.php b/app/Repositories/Eloquent/DatabaseRepository.php index df9dbb6e..48dec217 100644 --- a/app/Repositories/Eloquent/DatabaseRepository.php +++ b/app/Repositories/Eloquent/DatabaseRepository.php @@ -140,7 +140,7 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor */ public function createUser(string $username, string $remote, string $password, $max_connections): bool { - if (!$max_connections) { + if (! $max_connections) { return $this->run(sprintf('CREATE USER `%s`@`%s` IDENTIFIED BY \'%s\'', $username, $remote, $password)); } else { return $this->run(sprintf('CREATE USER `%s`@`%s` IDENTIFIED BY \'%s\' WITH MAX_USER_CONNECTIONS %s', $username, $remote, $password, $max_connections)); diff --git a/app/Repositories/Eloquent/SessionRepository.php b/app/Repositories/Eloquent/SessionRepository.php index 50d9d336..54c4ff62 100644 --- a/app/Repositories/Eloquent/SessionRepository.php +++ b/app/Repositories/Eloquent/SessionRepository.php @@ -34,7 +34,7 @@ class SessionRepository extends EloquentRepository implements SessionRepositoryI * * @param int $user * @param string $session - * @return null|int + * @return int|null */ public function deleteUserSession(int $user, string $session) { diff --git a/app/Repositories/Eloquent/TaskRepository.php b/app/Repositories/Eloquent/TaskRepository.php index 0c1202f5..3b43221e 100644 --- a/app/Repositories/Eloquent/TaskRepository.php +++ b/app/Repositories/Eloquent/TaskRepository.php @@ -41,7 +41,7 @@ class TaskRepository extends EloquentRepository implements TaskRepositoryInterfa * * @param int $schedule * @param int $index - * @return null|\Pterodactyl\Models\Task + * @return \Pterodactyl\Models\Task|null */ public function getNextTask(int $schedule, int $index) { diff --git a/app/Services/Helpers/AssetHashService.php b/app/Services/Helpers/AssetHashService.php index c3d4c98f..f9b6a2cd 100644 --- a/app/Services/Helpers/AssetHashService.php +++ b/app/Services/Helpers/AssetHashService.php @@ -24,7 +24,7 @@ class AssetHashService private $application; /** - * @var null|array + * @var array|null */ protected static $manifest; diff --git a/bootstrap/tests.php b/bootstrap/tests.php index c1a6c8fb..e2233462 100644 --- a/bootstrap/tests.php +++ b/bootstrap/tests.php @@ -27,7 +27,7 @@ if (config('database.default') !== 'testing') { * Perform database migrations and reseeding before continuing with * running the tests. */ -if (!env('SKIP_MIGRATIONS')) { +if (! env('SKIP_MIGRATIONS')) { $output->writeln(PHP_EOL . 'Refreshing database for Integration tests...'); $kernel->call('migrate:fresh', ['--database' => 'testing']); diff --git a/config/logging.php b/config/logging.php index 33b6a5d0..7da06f40 100644 --- a/config/logging.php +++ b/config/logging.php @@ -3,7 +3,6 @@ use Monolog\Handler\StreamHandler; return [ - /* |-------------------------------------------------------------------------- | Default Log Channel @@ -77,5 +76,4 @@ return [ 'level' => 'debug', ], ], - ]; diff --git a/database/migrations/2017_07_24_194433_DeleteTaskWhenParentServerIsDeleted.php b/database/migrations/2017_07_24_194433_DeleteTaskWhenParentServerIsDeleted.php index 042e7564..89e11022 100644 --- a/database/migrations/2017_07_24_194433_DeleteTaskWhenParentServerIsDeleted.php +++ b/database/migrations/2017_07_24_194433_DeleteTaskWhenParentServerIsDeleted.php @@ -23,6 +23,5 @@ class DeleteTaskWhenParentServerIsDeleted extends Migration */ public function down() { - // } } 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 c1787a9b..dfd55fb4 100644 --- a/database/migrations/2020_04_17_203438_allow_nullable_descriptions.php +++ b/database/migrations/2020_04_17_203438_allow_nullable_descriptions.php @@ -1,8 +1,8 @@ getContents()); if (json_last_error() !== JSON_ERROR_NONE) { $this->command->error('JSON decode exception for ' . $file->getFilename() . ': ' . json_last_error_msg()); + return; }