Use more standardized phpcs

This commit is contained in:
Dane Everitt 2021-01-23 12:33:34 -08:00
parent a043071e3c
commit c449ca5155
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
493 changed files with 1116 additions and 3903 deletions

33
.php_cs
View File

@ -1,7 +1,9 @@
<?php <?php
$finder = PhpCsFixer\Finder::create() use PhpCsFixer\Config;
->in([ use PhpCsFixer\Finder;
$finder = (new Finder)->in([
'app', 'app',
'bootstrap', 'bootstrap',
'config', 'config',
@ -11,48 +13,31 @@ $finder = PhpCsFixer\Finder::create()
'tests', 'tests',
]); ]);
return PhpCsFixer\Config::create() return (new Config)
->setRiskyAllowed(true)
->setFinder($finder)
->setRules([ ->setRules([
'@Symfony' => true, '@Symfony' => true,
'@PSR1' => true, '@PSR1' => true,
'@PSR2' => true, '@PSR2' => true,
'@PSR12' => true,
'align_multiline_comment' => ['comment_type' => 'phpdocs_like'], 'align_multiline_comment' => ['comment_type' => 'phpdocs_like'],
'array_syntax' => ['syntax' => 'short'],
'blank_line_before_return' => true,
'blank_line_before_statement' => false,
'combine_consecutive_unsets' => true, 'combine_consecutive_unsets' => true,
'concat_space' => ['spacing' => 'one'], 'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'single'],
'heredoc_to_nowdoc' => true, 'heredoc_to_nowdoc' => true,
'increment_style' => ['style' => 'post'],
'linebreak_after_opening_tag' => true,
'method_argument_space' => [
'ensure_fully_multiline' => false,
'keep_multiple_spaces_after_comma' => false,
],
'new_with_braces' => false,
'no_alias_functions' => true, 'no_alias_functions' => true,
'no_multiline_whitespace_before_semicolons' => true,
'no_superfluous_phpdoc_tags' => false,
'no_unreachable_default_argument_value' => true, 'no_unreachable_default_argument_value' => true,
'no_useless_return' => true, 'no_useless_return' => true,
'not_operator_with_successor_space' => true,
'ordered_imports' => [ 'ordered_imports' => [
'sortAlgorithm' => 'length', 'sortAlgorithm' => 'length',
], ],
'phpdoc_align' => false,
'phpdoc_separation' => false,
'protected_to_private' => false,
'psr0' => ['dir' => 'app'], 'psr0' => ['dir' => 'app'],
'psr4' => true, 'psr4' => true,
'random_api_migration' => true, 'random_api_migration' => true,
'single_line_throw' => false,
'single_trait_insert_per_statement' => false,
'standardize_not_equals' => true,
'ternary_to_null_coalescing' => true, 'ternary_to_null_coalescing' => true,
'yoda_style' => [ 'yoda_style' => [
'equal' => false, 'equal' => false,
'identical' => false, 'identical' => false,
'less_and_greater' => false, 'less_and_greater' => false,
], ],
])->setRiskyAllowed(true)->setFinder($finder); ]);

View File

@ -19,13 +19,13 @@ class AppSettingsCommand extends Command
{ {
use EnvironmentWriterTrait; use EnvironmentWriterTrait;
const ALLOWED_CACHE_DRIVERS = [ public const ALLOWED_CACHE_DRIVERS = [
'redis' => 'Redis (recommended)', 'redis' => 'Redis (recommended)',
'memcached' => 'Memcached', 'memcached' => 'Memcached',
'file' => 'Filesystem', 'file' => 'Filesystem',
]; ];
const ALLOWED_SESSION_DRIVERS = [ public const ALLOWED_SESSION_DRIVERS = [
'redis' => 'Redis (recommended)', 'redis' => 'Redis (recommended)',
'memcached' => 'Memcached', 'memcached' => 'Memcached',
'database' => 'MySQL Database', 'database' => 'MySQL Database',
@ -33,7 +33,7 @@ class AppSettingsCommand extends Command
'cookie' => 'Cookie', 'cookie' => 'Cookie',
]; ];
const ALLOWED_QUEUE_DRIVERS = [ public const ALLOWED_QUEUE_DRIVERS = [
'redis' => 'Redis (recommended)', 'redis' => 'Redis (recommended)',
'database' => 'MySQL Database', 'database' => 'MySQL Database',
'sync' => 'Sync', 'sync' => 'Sync',
@ -77,9 +77,6 @@ class AppSettingsCommand extends Command
/** /**
* AppSettingsCommand constructor. * AppSettingsCommand constructor.
*
* @param \Illuminate\Contracts\Config\Repository $config
* @param \Illuminate\Contracts\Console\Kernel $command
*/ */
public function __construct(ConfigRepository $config, Kernel $command) public function __construct(ConfigRepository $config, Kernel $command)
{ {
@ -102,12 +99,14 @@ class AppSettingsCommand extends Command
$this->output->comment(trans('command/messages.environment.app.author_help')); $this->output->comment(trans('command/messages.environment.app.author_help'));
$this->variables['APP_SERVICE_AUTHOR'] = $this->option('author') ?? $this->ask( $this->variables['APP_SERVICE_AUTHOR'] = $this->option('author') ?? $this->ask(
trans('command/messages.environment.app.author'), $this->config->get('pterodactyl.service.author', 'unknown@unknown.com') trans('command/messages.environment.app.author'),
$this->config->get('pterodactyl.service.author', 'unknown@unknown.com')
); );
$this->output->comment(trans('command/messages.environment.app.app_url_help')); $this->output->comment(trans('command/messages.environment.app.app_url_help'));
$this->variables['APP_URL'] = $this->option('url') ?? $this->ask( $this->variables['APP_URL'] = $this->option('url') ?? $this->ask(
trans('command/messages.environment.app.app_url'), $this->config->get('app.url', 'http://example.org') trans('command/messages.environment.app.app_url'),
$this->config->get('app.url', 'http://example.org')
); );
$this->output->comment(trans('command/messages.environment.app.timezone_help')); $this->output->comment(trans('command/messages.environment.app.timezone_help'));
@ -171,7 +170,8 @@ class AppSettingsCommand extends Command
$this->output->note(trans('command/messages.environment.app.using_redis')); $this->output->note(trans('command/messages.environment.app.using_redis'));
$this->variables['REDIS_HOST'] = $this->option('redis-host') ?? $this->ask( $this->variables['REDIS_HOST'] = $this->option('redis-host') ?? $this->ask(
trans('command/messages.environment.app.redis_host'), $this->config->get('database.redis.default.host') trans('command/messages.environment.app.redis_host'),
$this->config->get('database.redis.default.host')
); );
$askForRedisPassword = true; $askForRedisPassword = true;
@ -192,7 +192,8 @@ class AppSettingsCommand extends Command
} }
$this->variables['REDIS_PORT'] = $this->option('redis-port') ?? $this->ask( $this->variables['REDIS_PORT'] = $this->option('redis-port') ?? $this->ask(
trans('command/messages.environment.app.redis_port'), $this->config->get('database.redis.default.port') trans('command/messages.environment.app.redis_port'),
$this->config->get('database.redis.default.port')
); );
} }
} }

View File

@ -57,10 +57,6 @@ class DatabaseSettingsCommand extends Command
/** /**
* DatabaseSettingsCommand constructor. * DatabaseSettingsCommand constructor.
*
* @param \Illuminate\Contracts\Config\Repository $config
* @param \Illuminate\Database\DatabaseManager $database
* @param \Illuminate\Contracts\Console\Kernel $console
*/ */
public function __construct(ConfigRepository $config, DatabaseManager $database, Kernel $console) public function __construct(ConfigRepository $config, DatabaseManager $database, Kernel $console)
{ {
@ -82,20 +78,24 @@ class DatabaseSettingsCommand extends Command
{ {
$this->output->note(trans('command/messages.environment.database.host_warning')); $this->output->note(trans('command/messages.environment.database.host_warning'));
$this->variables['DB_HOST'] = $this->option('host') ?? $this->ask( $this->variables['DB_HOST'] = $this->option('host') ?? $this->ask(
trans('command/messages.environment.database.host'), $this->config->get('database.connections.mysql.host', '127.0.0.1') trans('command/messages.environment.database.host'),
$this->config->get('database.connections.mysql.host', '127.0.0.1')
); );
$this->variables['DB_PORT'] = $this->option('port') ?? $this->ask( $this->variables['DB_PORT'] = $this->option('port') ?? $this->ask(
trans('command/messages.environment.database.port'), $this->config->get('database.connections.mysql.port', 3306) trans('command/messages.environment.database.port'),
$this->config->get('database.connections.mysql.port', 3306)
); );
$this->variables['DB_DATABASE'] = $this->option('database') ?? $this->ask( $this->variables['DB_DATABASE'] = $this->option('database') ?? $this->ask(
trans('command/messages.environment.database.database'), $this->config->get('database.connections.mysql.database', 'panel') trans('command/messages.environment.database.database'),
$this->config->get('database.connections.mysql.database', 'panel')
); );
$this->output->note(trans('command/messages.environment.database.username_warning')); $this->output->note(trans('command/messages.environment.database.username_warning'));
$this->variables['DB_USERNAME'] = $this->option('username') ?? $this->ask( $this->variables['DB_USERNAME'] = $this->option('username') ?? $this->ask(
trans('command/messages.environment.database.username'), $this->config->get('database.connections.mysql.username', 'pterodactyl') trans('command/messages.environment.database.username'),
$this->config->get('database.connections.mysql.username', 'pterodactyl')
); );
$askForMySQLPassword = true; $askForMySQLPassword = true;

View File

@ -47,8 +47,6 @@ class EmailSettingsCommand extends Command
/** /**
* EmailSettingsCommand constructor. * EmailSettingsCommand constructor.
*
* @param \Illuminate\Contracts\Config\Repository $config
*/ */
public function __construct(ConfigRepository $config) public function __construct(ConfigRepository $config)
{ {
@ -65,13 +63,15 @@ class EmailSettingsCommand extends Command
public function handle() public function handle()
{ {
$this->variables['MAIL_DRIVER'] = $this->option('driver') ?? $this->choice( $this->variables['MAIL_DRIVER'] = $this->option('driver') ?? $this->choice(
trans('command/messages.environment.mail.ask_driver'), [ trans('command/messages.environment.mail.ask_driver'),
[
'smtp' => 'SMTP Server', 'smtp' => 'SMTP Server',
'mail' => 'PHP\'s Internal Mail Function', 'mail' => 'PHP\'s Internal Mail Function',
'mailgun' => 'Mailgun Transactional Email', 'mailgun' => 'Mailgun Transactional Email',
'mandrill' => 'Mandrill Transactional Email', 'mandrill' => 'Mandrill Transactional Email',
'postmark' => 'Postmarkapp Transactional Email', 'postmark' => 'Postmarkapp Transactional Email',
], $this->config->get('mail.driver', 'smtp') ],
$this->config->get('mail.driver', 'smtp')
); );
$method = 'setup' . studly_case($this->variables['MAIL_DRIVER']) . 'DriverVariables'; $method = 'setup' . studly_case($this->variables['MAIL_DRIVER']) . 'DriverVariables';
@ -80,15 +80,19 @@ class EmailSettingsCommand extends Command
} }
$this->variables['MAIL_FROM'] = $this->option('email') ?? $this->ask( $this->variables['MAIL_FROM'] = $this->option('email') ?? $this->ask(
trans('command/messages.environment.mail.ask_mail_from'), $this->config->get('mail.from.address') trans('command/messages.environment.mail.ask_mail_from'),
$this->config->get('mail.from.address')
); );
$this->variables['MAIL_FROM_NAME'] = $this->option('from') ?? $this->ask( $this->variables['MAIL_FROM_NAME'] = $this->option('from') ?? $this->ask(
trans('command/messages.environment.mail.ask_mail_name'), $this->config->get('mail.from.name') trans('command/messages.environment.mail.ask_mail_name'),
$this->config->get('mail.from.name')
); );
$this->variables['MAIL_ENCRYPTION'] = $this->option('encryption') ?? $this->choice( $this->variables['MAIL_ENCRYPTION'] = $this->option('encryption') ?? $this->choice(
trans('command/messages.environment.mail.ask_encryption'), ['tls' => 'TLS', 'ssl' => 'SSL', '' => 'None'], $this->config->get('mail.encryption', 'tls') trans('command/messages.environment.mail.ask_encryption'),
['tls' => 'TLS', 'ssl' => 'SSL', '' => 'None'],
$this->config->get('mail.encryption', 'tls')
); );
$this->writeToEnvironment($this->variables); $this->writeToEnvironment($this->variables);
@ -103,15 +107,18 @@ class EmailSettingsCommand extends Command
private function setupSmtpDriverVariables() private function setupSmtpDriverVariables()
{ {
$this->variables['MAIL_HOST'] = $this->option('host') ?? $this->ask( $this->variables['MAIL_HOST'] = $this->option('host') ?? $this->ask(
trans('command/messages.environment.mail.ask_smtp_host'), $this->config->get('mail.host') trans('command/messages.environment.mail.ask_smtp_host'),
$this->config->get('mail.host')
); );
$this->variables['MAIL_PORT'] = $this->option('port') ?? $this->ask( $this->variables['MAIL_PORT'] = $this->option('port') ?? $this->ask(
trans('command/messages.environment.mail.ask_smtp_port'), $this->config->get('mail.port') trans('command/messages.environment.mail.ask_smtp_port'),
$this->config->get('mail.port')
); );
$this->variables['MAIL_USERNAME'] = $this->option('username') ?? $this->ask( $this->variables['MAIL_USERNAME'] = $this->option('username') ?? $this->ask(
trans('command/messages.environment.mail.ask_smtp_username'), $this->config->get('mail.username') trans('command/messages.environment.mail.ask_smtp_username'),
$this->config->get('mail.username')
); );
$this->variables['MAIL_PASSWORD'] = $this->option('password') ?? $this->secret( $this->variables['MAIL_PASSWORD'] = $this->option('password') ?? $this->secret(
@ -125,11 +132,13 @@ class EmailSettingsCommand extends Command
private function setupMailgunDriverVariables() private function setupMailgunDriverVariables()
{ {
$this->variables['MAILGUN_DOMAIN'] = $this->option('host') ?? $this->ask( $this->variables['MAILGUN_DOMAIN'] = $this->option('host') ?? $this->ask(
trans('command/messages.environment.mail.ask_mailgun_domain'), $this->config->get('services.mailgun.domain') trans('command/messages.environment.mail.ask_mailgun_domain'),
$this->config->get('services.mailgun.domain')
); );
$this->variables['MAILGUN_SECRET'] = $this->option('password') ?? $this->ask( $this->variables['MAILGUN_SECRET'] = $this->option('password') ?? $this->ask(
trans('command/messages.environment.mail.ask_mailgun_secret'), $this->config->get('services.mailgun.secret') trans('command/messages.environment.mail.ask_mailgun_secret'),
$this->config->get('services.mailgun.secret')
); );
} }
@ -139,7 +148,8 @@ class EmailSettingsCommand extends Command
private function setupMandrillDriverVariables() private function setupMandrillDriverVariables()
{ {
$this->variables['MANDRILL_SECRET'] = $this->option('password') ?? $this->ask( $this->variables['MANDRILL_SECRET'] = $this->option('password') ?? $this->ask(
trans('command/messages.environment.mail.ask_mandrill_secret'), $this->config->get('services.mandrill.secret') trans('command/messages.environment.mail.ask_mandrill_secret'),
$this->config->get('services.mandrill.secret')
); );
} }
@ -152,7 +162,8 @@ class EmailSettingsCommand extends Command
$this->variables['MAIL_HOST'] = 'smtp.postmarkapp.com'; $this->variables['MAIL_HOST'] = 'smtp.postmarkapp.com';
$this->variables['MAIL_PORT'] = 587; $this->variables['MAIL_PORT'] = 587;
$this->variables['MAIL_USERNAME'] = $this->variables['MAIL_PASSWORD'] = $this->option('username') ?? $this->ask( $this->variables['MAIL_USERNAME'] = $this->variables['MAIL_PASSWORD'] = $this->option('username') ?? $this->ask(
trans('command/messages.environment.mail.ask_postmark_username'), $this->config->get('mail.username') trans('command/messages.environment.mail.ask_postmark_username'),
$this->config->get('mail.username')
); );
} }
} }

View File

@ -37,9 +37,6 @@ class InfoCommand extends Command
/** /**
* VersionCommand constructor. * VersionCommand constructor.
*
* @param \Illuminate\Contracts\Config\Repository $config
* @param \Pterodactyl\Services\Helpers\SoftwareVersionService $versionService
*/ */
public function __construct(ConfigRepository $config, SoftwareVersionService $versionService) public function __construct(ConfigRepository $config, SoftwareVersionService $versionService)
{ {
@ -104,6 +101,7 @@ class InfoCommand extends Command
* *
* @param string $value * @param string $value
* @param string $opts * @param string $opts
*
* @return string * @return string
*/ */
private function formatText($value, $opts = '') private function formatText($value, $opts = '')

View File

@ -42,9 +42,6 @@ class DeleteLocationCommand extends Command
/** /**
* DeleteLocationCommand constructor. * DeleteLocationCommand constructor.
*
* @param \Pterodactyl\Contracts\Repository\LocationRepositoryInterface $repository
* @param \Pterodactyl\Services\Locations\LocationDeletionService $deletionService
*/ */
public function __construct( public function __construct(
LocationDeletionService $deletionService, LocationDeletionService $deletionService,
@ -66,7 +63,8 @@ class DeleteLocationCommand extends Command
{ {
$this->locations = $this->locations ?? $this->repository->all(); $this->locations = $this->locations ?? $this->repository->all();
$short = $this->option('short') ?? $this->anticipate( $short = $this->option('short') ?? $this->anticipate(
trans('command/messages.location.ask_short'), $this->locations->pluck('short')->toArray() trans('command/messages.location.ask_short'),
$this->locations->pluck('short')->toArray()
); );
$location = $this->locations->where('short', $short)->first(); $location = $this->locations->where('short', $short)->first();

View File

@ -33,8 +33,6 @@ class MakeLocationCommand extends Command
/** /**
* Create a new command instance. * Create a new command instance.
*
* @param \Pterodactyl\Services\Locations\LocationCreationService $creationService
*/ */
public function __construct(LocationCreationService $creationService) public function __construct(LocationCreationService $creationService)
{ {

View File

@ -9,7 +9,7 @@ use Illuminate\Contracts\Filesystem\Factory as FilesystemFactory;
class CleanServiceBackupFilesCommand extends Command class CleanServiceBackupFilesCommand extends Command
{ {
const BACKUP_THRESHOLD_MINUTES = 5; public const BACKUP_THRESHOLD_MINUTES = 5;
/** /**
* @var string * @var string
@ -28,8 +28,6 @@ class CleanServiceBackupFilesCommand extends Command
/** /**
* CleanServiceBackupFilesCommand constructor. * CleanServiceBackupFilesCommand constructor.
*
* @param \Illuminate\Contracts\Filesystem\Factory $filesystem
*/ */
public function __construct(FilesystemFactory $filesystem) public function __construct(FilesystemFactory $filesystem)
{ {

View File

@ -19,9 +19,6 @@ class PruneOrphanedBackupsCommand extends Command
*/ */
protected $description = 'Marks all backups that have not completed in the last "n" minutes as being failed.'; protected $description = 'Marks all backups that have not completed in the last "n" minutes as being failed.';
/**
* @param \Pterodactyl\Repositories\Eloquent\BackupRepository $repository
*/
public function handle(BackupRepository $repository) public function handle(BackupRepository $repository)
{ {
$since = $this->option('since-minutes'); $since = $this->option('since-minutes');

View File

@ -25,8 +25,6 @@ class CleanOrphanedApiKeysCommand extends Command
/** /**
* CleanOrphanedApiKeysCommand constructor. * CleanOrphanedApiKeysCommand constructor.
*
* @param \Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface $repository
*/ */
public function __construct(ApiKeyRepositoryInterface $repository) public function __construct(ApiKeyRepositoryInterface $repository)
{ {
@ -44,7 +42,8 @@ class CleanOrphanedApiKeysCommand extends Command
{ {
$count = $this->repository->findCountWhere([['key_type', '=', ApiKey::TYPE_NONE]]); $count = $this->repository->findCountWhere([['key_type', '=', ApiKey::TYPE_NONE]]);
$continue = $this->confirm( $continue = $this->confirm(
'This action will remove ' . $count . ' keys from the database. Are you sure you wish to continue?', false 'This action will remove ' . $count . ' keys from the database. Are you sure you wish to continue?',
false
); );
if (!$continue) { if (!$continue) {

View File

@ -54,7 +54,6 @@ class ProcessRunnableCommand extends Command
* never throw an exception out, otherwise you'll end up killing the entire run group causing * never throw an exception out, otherwise you'll end up killing the entire run group causing
* any other schedules to not process correctly. * any other schedules to not process correctly.
* *
* @param \Pterodactyl\Models\Schedule $schedule
* @see https://github.com/pterodactyl/panel/issues/2609 * @see https://github.com/pterodactyl/panel/issues/2609
*/ */
protected function processSchedule(Schedule $schedule) protected function processSchedule(Schedule $schedule)

View File

@ -27,8 +27,6 @@ class BulkPowerActionCommand extends Command
/** /**
* Handle the bulk power request. * Handle the bulk power request.
* *
* @param \Pterodactyl\Repositories\Wings\DaemonPowerRepository $powerRepository
* @param \Illuminate\Validation\Factory $validator
* @throws \Illuminate\Validation\ValidationException * @throws \Illuminate\Validation\ValidationException
*/ */
public function handle(DaemonPowerRepository $powerRepository, ValidatorFactory $validator) public function handle(DaemonPowerRepository $powerRepository, ValidatorFactory $validator)
@ -87,8 +85,6 @@ class BulkPowerActionCommand extends Command
/** /**
* Returns the query builder instance that will return the servers that should be affected. * Returns the query builder instance that will return the servers that should be affected.
* *
* @param array $servers
* @param array $nodes
* @return \Illuminate\Database\Eloquent\Builder * @return \Illuminate\Database\Eloquent\Builder
*/ */
protected function getQueryBuilder(array $servers, array $nodes) protected function getQueryBuilder(array $servers, array $nodes)

View File

@ -47,10 +47,6 @@ class BulkReinstallActionCommand extends Command
/** /**
* BulkReinstallActionCommand constructor. * BulkReinstallActionCommand constructor.
*
* @param \Pterodactyl\Repositories\Wings\DaemonServerRepository $daemonRepository
* @param \Pterodactyl\Services\Servers\ServerConfigurationStructureService $configurationStructureService
* @param \Pterodactyl\Repositories\Eloquent\ServerRepository $repository
*/ */
public function __construct( public function __construct(
DaemonServerRepository $daemonRepository, DaemonServerRepository $daemonRepository,

View File

@ -38,8 +38,6 @@ class DeleteUserCommand extends Command
/** /**
* DeleteUserCommand constructor. * DeleteUserCommand constructor.
*
* @param \Pterodactyl\Services\Users\UserDeletionService $deletionService
*/ */
public function __construct(UserDeletionService $deletionService) public function __construct(UserDeletionService $deletionService)
{ {
@ -50,6 +48,7 @@ class DeleteUserCommand extends Command
/** /**
* @return bool * @return bool
*
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException
*/ */
public function handle() public function handle()

View File

@ -31,8 +31,6 @@ class DisableTwoFactorCommand extends Command
/** /**
* DisableTwoFactorCommand constructor. * DisableTwoFactorCommand constructor.
*
* @param \Pterodactyl\Contracts\Repository\UserRepositoryInterface $repository
*/ */
public function __construct(UserRepositoryInterface $repository) public function __construct(UserRepositoryInterface $repository)
{ {

View File

@ -31,8 +31,6 @@ class MakeUserCommand extends Command
/** /**
* MakeUserCommand constructor. * MakeUserCommand constructor.
*
* @param \Pterodactyl\Services\Users\UserCreationService $creationService
*/ */
public function __construct(UserCreationService $creationService) public function __construct(UserCreationService $creationService)
{ {

View File

@ -17,8 +17,6 @@ class Kernel extends ConsoleKernel
/** /**
* Define the application's command schedule. * Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*/ */
protected function schedule(Schedule $schedule) protected function schedule(Schedule $schedule)
{ {

View File

@ -9,8 +9,6 @@ trait RequiresDatabaseMigrations
{ {
/** /**
* Checks if the migrations have finished running by comparing the last migration file. * Checks if the migrations have finished running by comparing the last migration file.
*
* @return bool
*/ */
protected function hasCompletedMigrations(): bool protected function hasCompletedMigrations(): bool
{ {
@ -34,8 +32,6 @@ trait RequiresDatabaseMigrations
* Throw a massive error into the console to hopefully catch the users attention and get * Throw a massive error into the console to hopefully catch the users attention and get
* them to properly run the migrations rather than ignoring all of the other previous * them to properly run the migrations rather than ignoring all of the other previous
* errors... * errors...
*
* @return int
*/ */
protected function showMigrationWarning(): int protected function showMigrationWarning(): int
{ {

View File

@ -8,8 +8,6 @@ interface ReceivesEvents
{ {
/** /**
* Handles receiving an event from the application. * Handles receiving an event from the application.
*
* @param \Pterodactyl\Events\Event $notification
*/ */
public function handle(Event $notification): void; public function handle(Event $notification): void;
} }

View File

@ -17,7 +17,7 @@ interface CriteriaInterface
* Apply selected criteria to a repository call. * Apply selected criteria to a repository call.
* *
* @param \Illuminate\Database\Eloquent\Model $model * @param \Illuminate\Database\Eloquent\Model $model
* @param \Pterodactyl\Repositories\Repository $repository *
* @return mixed * @return mixed
*/ */
public function apply($model, Repository $repository); public function apply($model, Repository $repository);

View File

@ -18,6 +18,7 @@ interface HashidsInterface extends VendorHashidsInterface
* *
* @param string $encoded * @param string $encoded
* @param null $default * @param null $default
*
* @return mixed * @return mixed
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException

View File

@ -8,8 +8,6 @@ interface ClientPermissionsRequest
* Returns the permissions string indicating which permission should be used to * Returns the permissions string indicating which permission should be used to
* validate that the authenticated user has permission to perform this action aganist * validate that the authenticated user has permission to perform this action aganist
* the given resource (server). * the given resource (server).
*
* @return string
*/ */
public function permission(): string; public function permission(): string;
} }

View File

@ -7,18 +7,12 @@ interface AllocationRepositoryInterface extends RepositoryInterface
/** /**
* Return all of the allocations that exist for a node that are not currently * Return all of the allocations that exist for a node that are not currently
* allocated. * allocated.
*
* @param int $node
* @return array
*/ */
public function getUnassignedAllocationIds(int $node): array; public function getUnassignedAllocationIds(int $node): array;
/** /**
* Return a single allocation from those meeting the requirements. * Return a single allocation from those meeting the requirements.
* *
* @param array $nodes
* @param array $ports
* @param bool $dedicated
* @return \Pterodactyl\Models\Allocation|null * @return \Pterodactyl\Models\Allocation|null
*/ */
public function getRandomAllocation(array $nodes, array $ports, bool $dedicated = false); public function getRandomAllocation(array $nodes, array $ports, bool $dedicated = false);

View File

@ -9,35 +9,21 @@ interface ApiKeyRepositoryInterface extends RepositoryInterface
{ {
/** /**
* Get all of the account API keys that exist for a specific user. * Get all of the account API keys that exist for a specific user.
*
* @param \Pterodactyl\Models\User $user
* @return \Illuminate\Support\Collection
*/ */
public function getAccountKeys(User $user): Collection; public function getAccountKeys(User $user): Collection;
/** /**
* Get all of the application API keys that exist for a specific user. * Get all of the application API keys that exist for a specific user.
*
* @param \Pterodactyl\Models\User $user
* @return \Illuminate\Support\Collection
*/ */
public function getApplicationKeys(User $user): Collection; public function getApplicationKeys(User $user): Collection;
/** /**
* Delete an account API key from the panel for a specific user. * Delete an account API key from the panel for a specific user.
*
* @param \Pterodactyl\Models\User $user
* @param string $identifier
* @return int
*/ */
public function deleteAccountKey(User $user, string $identifier): int; public function deleteAccountKey(User $user, string $identifier): int;
/** /**
* Delete an application API key from the panel for a specific user. * Delete an application API key from the panel for a specific user.
*
* @param \Pterodactyl\Models\User $user
* @param string $identifier
* @return int
*/ */
public function deleteApplicationKey(User $user, string $identifier): int; public function deleteApplicationKey(User $user, string $identifier): int;
} }

View File

@ -9,8 +9,6 @@ interface DatabaseHostRepositoryInterface extends RepositoryInterface
/** /**
* Return database hosts with a count of databases and the node * Return database hosts with a count of databases and the node
* information for which it is attached. * information for which it is attached.
*
* @return \Illuminate\Support\Collection
*/ */
public function getWithViewDetails(): Collection; public function getWithViewDetails(): Collection;
} }

View File

@ -8,89 +8,60 @@ use Illuminate\Contracts\Pagination\LengthAwarePaginator;
interface DatabaseRepositoryInterface extends RepositoryInterface interface DatabaseRepositoryInterface extends RepositoryInterface
{ {
const DEFAULT_CONNECTION_NAME = 'dynamic'; public const DEFAULT_CONNECTION_NAME = 'dynamic';
/** /**
* Set the connection name to execute statements against. * Set the connection name to execute statements against.
* *
* @param string $connection
* @return $this * @return $this
*/ */
public function setConnection(string $connection); public function setConnection(string $connection);
/** /**
* Return the connection to execute statements against. * Return the connection to execute statements against.
*
* @return string
*/ */
public function getConnection(): string; public function getConnection(): string;
/** /**
* Return all of the databases belonging to a server. * Return all of the databases belonging to a server.
*
* @param int $server
* @return \Illuminate\Support\Collection
*/ */
public function getDatabasesForServer(int $server): Collection; public function getDatabasesForServer(int $server): Collection;
/** /**
* Return all of the databases for a given host with the server relationship loaded. * Return all of the databases for a given host with the server relationship loaded.
*
* @param int $host
* @param int $count
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
*/ */
public function getDatabasesForHost(int $host, int $count = 25): LengthAwarePaginator; public function getDatabasesForHost(int $host, int $count = 25): LengthAwarePaginator;
/** /**
* Create a new database on a given connection. * Create a new database on a given connection.
*
* @param string $database
* @return bool
*/ */
public function createDatabase(string $database): bool; public function createDatabase(string $database): bool;
/** /**
* Create a new database user on a given connection. * Create a new database user on a given connection.
* *
* @param string $username
* @param string $remote
* @param string $password
* @param $max_connections * @param $max_connections
* @return bool
*/ */
public function createUser(string $username, string $remote, string $password, string $max_connections): bool; public function createUser(string $username, string $remote, string $password, string $max_connections): bool;
/** /**
* Give a specific user access to a given database. * Give a specific user access to a given database.
*
* @param string $database
* @param string $username
* @param string $remote
* @return bool
*/ */
public function assignUserToDatabase(string $database, string $username, string $remote): bool; public function assignUserToDatabase(string $database, string $username, string $remote): bool;
/** /**
* Flush the privileges for a given connection. * Flush the privileges for a given connection.
*
* @return bool
*/ */
public function flush(): bool; public function flush(): bool;
/** /**
* Drop a given database on a specific connection. * Drop a given database on a specific connection.
*
* @param string $database
* @return bool
*/ */
public function dropDatabase(string $database): bool; public function dropDatabase(string $database): bool;
/** /**
* Drop a given user on a specific connection. * Drop a given user on a specific connection.
* *
* @param string $username
* @param string $remote
* @return mixed * @return mixed
*/ */
public function dropUser(string $username, string $remote): bool; public function dropUser(string $username, string $remote): bool;

View File

@ -17,17 +17,12 @@ interface EggRepositoryInterface extends RepositoryInterface
/** /**
* Return an egg with the variables relation attached. * Return an egg with the variables relation attached.
* *
* @param int $id
* @return \Pterodactyl\Models\Egg
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function getWithVariables(int $id): Egg; public function getWithVariables(int $id): Egg;
/** /**
* Return all eggs and their relations to be used in the daemon API. * Return all eggs and their relations to be used in the daemon API.
*
* @return \Illuminate\Database\Eloquent\Collection
*/ */
public function getAllWithCopyAttributes(): Collection; public function getAllWithCopyAttributes(): Collection;
@ -35,27 +30,18 @@ interface EggRepositoryInterface extends RepositoryInterface
* Return an egg with the scriptFrom and configFrom relations loaded onto the model. * Return an egg with the scriptFrom and configFrom relations loaded onto the model.
* *
* @param int|string $value * @param int|string $value
* @param string $column
* @return \Pterodactyl\Models\Egg
*/ */
public function getWithCopyAttributes($value, string $column = 'id'): Egg; public function getWithCopyAttributes($value, string $column = 'id'): Egg;
/** /**
* Return all of the data needed to export a service. * Return all of the data needed to export a service.
* *
* @param int $id
* @return \Pterodactyl\Models\Egg
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function getWithExportAttributes(int $id): Egg; public function getWithExportAttributes(int $id): Egg;
/** /**
* Confirm a copy script belongs to the same nest as the item trying to use it. * Confirm a copy script belongs to the same nest as the item trying to use it.
*
* @param int $copyFromId
* @param int $service
* @return bool
*/ */
public function isCopyableScript(int $copyFromId, int $service): bool; public function isCopyableScript(int $copyFromId, int $service): bool;
} }

View File

@ -16,9 +16,6 @@ interface EggVariableRepositoryInterface extends RepositoryInterface
/** /**
* Return editable variables for a given egg. Editable variables must be set to * Return editable variables for a given egg. Editable variables must be set to
* user viewable in order to be picked up by this function. * user viewable in order to be picked up by this function.
*
* @param int $egg
* @return \Illuminate\Support\Collection
*/ */
public function getEditableVariables(int $egg): Collection; public function getEditableVariables(int $egg): Collection;
} }

View File

@ -9,22 +9,17 @@ interface LocationRepositoryInterface extends RepositoryInterface
{ {
/** /**
* Return locations with a count of nodes and servers attached to it. * Return locations with a count of nodes and servers attached to it.
*
* @return \Illuminate\Support\Collection
*/ */
public function getAllWithDetails(): Collection; public function getAllWithDetails(): Collection;
/** /**
* Return all of the available locations with the nodes as a relationship. * Return all of the available locations with the nodes as a relationship.
*
* @return \Illuminate\Support\Collection
*/ */
public function getAllWithNodes(): Collection; public function getAllWithNodes(): Collection;
/** /**
* Return all of the nodes and their respective count of servers for a location. * Return all of the nodes and their respective count of servers for a location.
* *
* @param int $id
* @return mixed * @return mixed
* *
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@ -34,7 +29,6 @@ interface LocationRepositoryInterface extends RepositoryInterface
/** /**
* Return a location and the count of nodes in that location. * Return a location and the count of nodes in that location.
* *
* @param int $id
* @return mixed * @return mixed
* *
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException

View File

@ -17,6 +17,7 @@ interface NestRepositoryInterface extends RepositoryInterface
* Return a nest or all nests with their associated eggs and variables. * Return a nest or all nests with their associated eggs and variables.
* *
* @param int $id * @param int $id
*
* @return \Illuminate\Database\Eloquent\Collection|\Pterodactyl\Models\Nest * @return \Illuminate\Database\Eloquent\Collection|\Pterodactyl\Models\Nest
* *
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@ -26,7 +27,6 @@ interface NestRepositoryInterface extends RepositoryInterface
/** /**
* Return a nest or all nests and the count of eggs and servers for that nest. * Return a nest or all nests and the count of eggs and servers for that nest.
* *
* @param int|null $id
* @return \Pterodactyl\Models\Nest|\Illuminate\Database\Eloquent\Collection * @return \Pterodactyl\Models\Nest|\Illuminate\Database\Eloquent\Collection
* *
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@ -36,9 +36,6 @@ interface NestRepositoryInterface extends RepositoryInterface
/** /**
* Return a nest along with its associated eggs and the servers relation on those eggs. * Return a nest along with its associated eggs and the servers relation on those eggs.
* *
* @param int $id
* @return \Pterodactyl\Models\Nest
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function getWithEggServers(int $id): Nest; public function getWithEggServers(int $id): Nest;

View File

@ -7,48 +7,32 @@ use Illuminate\Support\Collection;
interface NodeRepositoryInterface extends RepositoryInterface interface NodeRepositoryInterface extends RepositoryInterface
{ {
const THRESHOLD_PERCENTAGE_LOW = 75; public const THRESHOLD_PERCENTAGE_LOW = 75;
const THRESHOLD_PERCENTAGE_MEDIUM = 90; public const THRESHOLD_PERCENTAGE_MEDIUM = 90;
/** /**
* Return the usage stats for a single node. * Return the usage stats for a single node.
*
* @param \Pterodactyl\Models\Node $node
* @return array
*/ */
public function getUsageStats(Node $node): array; public function getUsageStats(Node $node): array;
/** /**
* Return the usage stats for a single node. * Return the usage stats for a single node.
*
* @param \Pterodactyl\Models\Node $node
* @return array
*/ */
public function getUsageStatsRaw(Node $node): array; public function getUsageStatsRaw(Node $node): array;
/** /**
* Return a single node with location and server information. * Return a single node with location and server information.
*
* @param \Pterodactyl\Models\Node $node
* @param bool $refresh
* @return \Pterodactyl\Models\Node
*/ */
public function loadLocationAndServerCount(Node $node, bool $refresh = false): Node; public function loadLocationAndServerCount(Node $node, bool $refresh = false): Node;
/** /**
* Attach a paginated set of allocations to a node mode including * Attach a paginated set of allocations to a node mode including
* any servers that are also attached to those allocations. * any servers that are also attached to those allocations.
*
* @param \Pterodactyl\Models\Node $node
* @param bool $refresh
* @return \Pterodactyl\Models\Node
*/ */
public function loadNodeAllocations(Node $node, bool $refresh = false): Node; public function loadNodeAllocations(Node $node, bool $refresh = false): Node;
/** /**
* Return a collection of nodes for all locations to use in server creation UI. * Return a collection of nodes for all locations to use in server creation UI.
*
* @return \Illuminate\Support\Collection
*/ */
public function getNodesForServerCreation(): Collection; public function getNodesForServerCreation(): Collection;
} }

View File

@ -39,6 +39,7 @@ interface RepositoryInterface
* An array of columns to filter the response by. * An array of columns to filter the response by.
* *
* @param array|string $columns * @param array|string $columns
*
* @return $this * @return $this
*/ */
public function setColumns($columns = ['*']); public function setColumns($columns = ['*']);
@ -62,7 +63,6 @@ interface RepositoryInterface
* Set whether or not the repository should return a fresh model * Set whether or not the repository should return a fresh model
* when changes are committed. * when changes are committed.
* *
* @param bool $fresh
* @return $this * @return $this
*/ */
public function setFreshModel(bool $fresh = true); public function setFreshModel(bool $fresh = true);
@ -70,9 +70,6 @@ interface RepositoryInterface
/** /**
* Create a new model instance and persist it to the database. * Create a new model instance and persist it to the database.
* *
* @param array $fields
* @param bool $validate
* @param bool $force
* @return mixed * @return mixed
* *
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -82,7 +79,6 @@ interface RepositoryInterface
/** /**
* Find a model that has the specific ID passed. * Find a model that has the specific ID passed.
* *
* @param int $id
* @return mixed * @return mixed
* *
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@ -91,16 +87,12 @@ interface RepositoryInterface
/** /**
* Find a model matching an array of where clauses. * Find a model matching an array of where clauses.
*
* @param array $fields
* @return \Illuminate\Support\Collection
*/ */
public function findWhere(array $fields): Collection; public function findWhere(array $fields): Collection;
/** /**
* Find and return the first matching instance for the given fields. * Find and return the first matching instance for the given fields.
* *
* @param array $fields
* @return mixed * @return mixed
* *
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@ -109,25 +101,16 @@ interface RepositoryInterface
/** /**
* Return a count of records matching the passed arguments. * Return a count of records matching the passed arguments.
*
* @param array $fields
* @return int
*/ */
public function findCountWhere(array $fields): int; public function findCountWhere(array $fields): int;
/** /**
* Delete a given record from the database. * Delete a given record from the database.
*
* @param int $id
* @return int
*/ */
public function delete(int $id): int; public function delete(int $id): int;
/** /**
* Delete records matching the given attributes. * Delete records matching the given attributes.
*
* @param array $attributes
* @return int
*/ */
public function deleteWhere(array $attributes): int; public function deleteWhere(array $attributes): int;
@ -135,9 +118,7 @@ interface RepositoryInterface
* Update a given ID with the passed array of fields. * Update a given ID with the passed array of fields.
* *
* @param int $id * @param int $id
* @param array $fields *
* @param bool $validate
* @param bool $force
* @return mixed * @return mixed
* *
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -148,21 +129,12 @@ interface RepositoryInterface
/** /**
* Perform a mass update where matching records are updated using whereIn. * Perform a mass update where matching records are updated using whereIn.
* This does not perform any model data validation. * This does not perform any model data validation.
*
* @param string $column
* @param array $values
* @param array $fields
* @return int
*/ */
public function updateWhereIn(string $column, array $values, array $fields): int; public function updateWhereIn(string $column, array $values, array $fields): int;
/** /**
* Update a record if it exists in the database, otherwise create it. * Update a record if it exists in the database, otherwise create it.
* *
* @param array $where
* @param array $fields
* @param bool $validate
* @param bool $force
* @return mixed * @return mixed
* *
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -171,40 +143,27 @@ interface RepositoryInterface
/** /**
* Return all records associated with the given model. * Return all records associated with the given model.
*
* @return Collection
*/ */
public function all(): Collection; public function all(): Collection;
/** /**
* Return a paginated result set using a search term if set on the repository. * Return a paginated result set using a search term if set on the repository.
*
* @param int $perPage
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
*/ */
public function paginated(int $perPage): LengthAwarePaginator; public function paginated(int $perPage): LengthAwarePaginator;
/** /**
* Insert a single or multiple records into the database at once skipping * Insert a single or multiple records into the database at once skipping
* validation and mass assignment checking. * validation and mass assignment checking.
*
* @param array $data
* @return bool
*/ */
public function insert(array $data): bool; public function insert(array $data): bool;
/** /**
* Insert multiple records into the database and ignore duplicates. * Insert multiple records into the database and ignore duplicates.
*
* @param array $values
* @return bool
*/ */
public function insertIgnore(array $values): bool; public function insertIgnore(array $values): bool;
/** /**
* Get the amount of entries in the database. * Get the amount of entries in the database.
*
* @return int
*/ */
public function count(): int; public function count(): int;
} }

View File

@ -9,18 +9,12 @@ interface ScheduleRepositoryInterface extends RepositoryInterface
{ {
/** /**
* Return all of the schedules for a given server. * Return all of the schedules for a given server.
*
* @param int $server
* @return \Illuminate\Support\Collection
*/ */
public function findServerSchedules(int $server): Collection; public function findServerSchedules(int $server): Collection;
/** /**
* Return a schedule model with all of the associated tasks as a relationship. * Return a schedule model with all of the associated tasks as a relationship.
* *
* @param int $schedule
* @return \Pterodactyl\Models\Schedule
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function getScheduleWithTasks(int $schedule): Schedule; public function getScheduleWithTasks(int $schedule): Schedule;

View File

@ -10,37 +10,22 @@ interface ServerRepositoryInterface extends RepositoryInterface
{ {
/** /**
* Load the egg relations onto the server model. * Load the egg relations onto the server model.
*
* @param \Pterodactyl\Models\Server $server
* @param bool $refresh
* @return \Pterodactyl\Models\Server
*/ */
public function loadEggRelations(Server $server, bool $refresh = false): Server; public function loadEggRelations(Server $server, bool $refresh = false): Server;
/** /**
* Return a collection of servers with their associated data for rebuild operations. * Return a collection of servers with their associated data for rebuild operations.
*
* @param int|null $server
* @param int|null $node
* @return \Illuminate\Support\Collection
*/ */
public function getDataForRebuild(int $server = null, int $node = null): Collection; public function getDataForRebuild(int $server = null, int $node = null): Collection;
/** /**
* Return a collection of servers with their associated data for reinstall operations. * Return a collection of servers with their associated data for reinstall operations.
*
* @param int|null $server
* @param int|null $node
* @return \Illuminate\Support\Collection
*/ */
public function getDataForReinstall(int $server = null, int $node = null): Collection; public function getDataForReinstall(int $server = null, int $node = null): Collection;
/** /**
* Return a server model and all variables associated with the server. * Return a server model and all variables associated with the server.
* *
* @param int $id
* @return \Pterodactyl\Models\Server
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function findWithVariables(int $id): Server; public function findWithVariables(int $id): Server;
@ -49,28 +34,16 @@ interface ServerRepositoryInterface extends RepositoryInterface
* Get the primary allocation for a given server. If a model is passed into * Get the primary allocation for a given server. If a model is passed into
* the function, load the allocation relationship onto it. Otherwise, find and * the function, load the allocation relationship onto it. Otherwise, find and
* return the server from the database. * return the server from the database.
*
* @param \Pterodactyl\Models\Server $server
* @param bool $refresh
* @return \Pterodactyl\Models\Server
*/ */
public function getPrimaryAllocation(Server $server, bool $refresh = false): Server; public function getPrimaryAllocation(Server $server, bool $refresh = false): Server;
/** /**
* Return enough data to be used for the creation of a server via the daemon. * Return enough data to be used for the creation of a server via the daemon.
*
* @param \Pterodactyl\Models\Server $server
* @param bool $refresh
* @return \Pterodactyl\Models\Server
*/ */
public function getDataForCreation(Server $server, bool $refresh = false): Server; public function getDataForCreation(Server $server, bool $refresh = false): Server;
/** /**
* Load associated databases onto the server model. * Load associated databases onto the server model.
*
* @param \Pterodactyl\Models\Server $server
* @param bool $refresh
* @return \Pterodactyl\Models\Server
*/ */
public function loadDatabaseRelations(Server $server, bool $refresh = false): Server; public function loadDatabaseRelations(Server $server, bool $refresh = false): Server;
@ -78,46 +51,28 @@ interface ServerRepositoryInterface extends RepositoryInterface
* Get data for use when updating a server on the Daemon. Returns an array of * Get data for use when updating a server on the Daemon. Returns an array of
* the egg which is used for build and rebuild. Only loads relations * the egg which is used for build and rebuild. Only loads relations
* if they are missing, or refresh is set to true. * if they are missing, or refresh is set to true.
*
* @param \Pterodactyl\Models\Server $server
* @param bool $refresh
* @return array
*/ */
public function getDaemonServiceData(Server $server, bool $refresh = false): array; public function getDaemonServiceData(Server $server, bool $refresh = false): array;
/** /**
* Return a server by UUID. * Return a server by UUID.
* *
* @param string $uuid
* @return \Pterodactyl\Models\Server
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function getByUuid(string $uuid): Server; public function getByUuid(string $uuid): Server;
/** /**
* Check if a given UUID and UUID-Short string are unique to a server. * Check if a given UUID and UUID-Short string are unique to a server.
*
* @param string $uuid
* @param string $short
* @return bool
*/ */
public function isUniqueUuidCombo(string $uuid, string $short): bool; public function isUniqueUuidCombo(string $uuid, string $short): bool;
/** /**
* Get the amount of servers that are suspended. * Get the amount of servers that are suspended.
*
* @return int
*/ */
public function getSuspendedServersCount(): int; public function getSuspendedServersCount(): int;
/** /**
* Returns all of the servers that exist for a given node in a paginated response. * Returns all of the servers that exist for a given node in a paginated response.
*
* @param int $node
* @param int $limit
*
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
*/ */
public function loadAllServersForNode(int $node, int $limit): LengthAwarePaginator; public function loadAllServersForNode(int $node, int $limit): LengthAwarePaginator;
} }

View File

@ -8,17 +8,12 @@ interface SessionRepositoryInterface extends RepositoryInterface
{ {
/** /**
* Return all of the active sessions for a user. * Return all of the active sessions for a user.
*
* @param int $user
* @return \Illuminate\Support\Collection
*/ */
public function getUserSessions(int $user): Collection; public function getUserSessions(int $user): Collection;
/** /**
* Delete a session for a given user. * Delete a session for a given user.
* *
* @param int $user
* @param string $session
* @return int|null * @return int|null
*/ */
public function deleteUserSession(int $user, string $session); public function deleteUserSession(int $user, string $session);

View File

@ -7,9 +7,6 @@ interface SettingsRepositoryInterface extends RepositoryInterface
/** /**
* Store a new persistent setting in the database. * Store a new persistent setting in the database.
* *
* @param string $key
* @param string|null $value
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
@ -18,16 +15,14 @@ interface SettingsRepositoryInterface extends RepositoryInterface
/** /**
* Retrieve a persistent setting from the database. * Retrieve a persistent setting from the database.
* *
* @param string $key
* @param mixed $default * @param mixed $default
*
* @return mixed * @return mixed
*/ */
public function get(string $key, $default); public function get(string $key, $default);
/** /**
* Remove a key from the database cache. * Remove a key from the database cache.
*
* @param string $key
*/ */
public function forget(string $key); public function forget(string $key);
} }

View File

@ -8,29 +8,17 @@ interface SubuserRepositoryInterface extends RepositoryInterface
{ {
/** /**
* Return a subuser with the associated server relationship. * Return a subuser with the associated server relationship.
*
* @param \Pterodactyl\Models\Subuser $subuser
* @param bool $refresh
* @return \Pterodactyl\Models\Subuser
*/ */
public function loadServerAndUserRelations(Subuser $subuser, bool $refresh = false): Subuser; public function loadServerAndUserRelations(Subuser $subuser, bool $refresh = false): Subuser;
/** /**
* Return a subuser with the associated permissions relationship. * Return a subuser with the associated permissions relationship.
*
* @param \Pterodactyl\Models\Subuser $subuser
* @param bool $refresh
* @return \Pterodactyl\Models\Subuser
*/ */
public function getWithPermissions(Subuser $subuser, bool $refresh = false): Subuser; public function getWithPermissions(Subuser $subuser, bool $refresh = false): Subuser;
/** /**
* Return a subuser and associated permissions given a user_id and server_id. * Return a subuser and associated permissions given a user_id and server_id.
* *
* @param int $user
* @param int $server
* @return \Pterodactyl\Models\Subuser
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function getWithPermissionsUsingUserAndServer(int $user, int $server): Subuser; public function getWithPermissionsUsingUserAndServer(int $user, int $server): Subuser;

View File

@ -9,9 +9,6 @@ interface TaskRepositoryInterface extends RepositoryInterface
/** /**
* Get a task and the server relationship for that task. * Get a task and the server relationship for that task.
* *
* @param int $id
* @return \Pterodactyl\Models\Task
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function getTaskForJobProcess(int $id): Task; public function getTaskForJobProcess(int $id): Task;
@ -19,8 +16,6 @@ interface TaskRepositoryInterface extends RepositoryInterface
/** /**
* Returns the next task in a schedule. * Returns the next task in a schedule.
* *
* @param int $schedule
* @param int $index
* @return \Pterodactyl\Models\Task|null * @return \Pterodactyl\Models\Task|null
*/ */
public function getNextTask(int $schedule, int $index); public function getNextTask(int $schedule, int $index);

View File

@ -25,8 +25,6 @@ class Created
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Server $server
*/ */
public function __construct(Server $server) public function __construct(Server $server)
{ {

View File

@ -25,8 +25,6 @@ class Creating
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Server $server
*/ */
public function __construct(Server $server) public function __construct(Server $server)
{ {

View File

@ -25,8 +25,6 @@ class Deleted
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Server $server
*/ */
public function __construct(Server $server) public function __construct(Server $server)
{ {

View File

@ -25,8 +25,6 @@ class Deleting
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Server $server
*/ */
public function __construct(Server $server) public function __construct(Server $server)
{ {

View File

@ -25,8 +25,6 @@ class Saved
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Server $server
*/ */
public function __construct(Server $server) public function __construct(Server $server)
{ {

View File

@ -25,8 +25,6 @@ class Saving
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Server $server
*/ */
public function __construct(Server $server) public function __construct(Server $server)
{ {

View File

@ -25,8 +25,6 @@ class Updated
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Server $server
*/ */
public function __construct(Server $server) public function __construct(Server $server)
{ {

View File

@ -25,8 +25,6 @@ class Updating
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Server $server
*/ */
public function __construct(Server $server) public function __construct(Server $server)
{ {

View File

@ -25,8 +25,6 @@ class Created
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Subuser $subuser
*/ */
public function __construct(Subuser $subuser) public function __construct(Subuser $subuser)
{ {

View File

@ -25,8 +25,6 @@ class Creating
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Subuser $subuser
*/ */
public function __construct(Subuser $subuser) public function __construct(Subuser $subuser)
{ {

View File

@ -25,8 +25,6 @@ class Deleted
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Subuser $subuser
*/ */
public function __construct(Subuser $subuser) public function __construct(Subuser $subuser)
{ {

View File

@ -25,8 +25,6 @@ class Deleting
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\Subuser $subuser
*/ */
public function __construct(Subuser $subuser) public function __construct(Subuser $subuser)
{ {

View File

@ -25,8 +25,6 @@ class Created
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\User $user
*/ */
public function __construct(User $user) public function __construct(User $user)
{ {

View File

@ -25,8 +25,6 @@ class Creating
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\User $user
*/ */
public function __construct(User $user) public function __construct(User $user)
{ {

View File

@ -25,8 +25,6 @@ class Deleted
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\User $user
*/ */
public function __construct(User $user) public function __construct(User $user)
{ {

View File

@ -25,8 +25,6 @@ class Deleting
/** /**
* Create a new event instance. * Create a new event instance.
*
* @param \Pterodactyl\Models\User $user
*/ */
public function __construct(User $user) public function __construct(User $user)
{ {

View File

@ -11,10 +11,10 @@ use Prologue\Alerts\AlertsMessageBag;
class DisplayException extends PterodactylException class DisplayException extends PterodactylException
{ {
const LEVEL_DEBUG = 'debug'; public const LEVEL_DEBUG = 'debug';
const LEVEL_INFO = 'info'; public const LEVEL_INFO = 'info';
const LEVEL_WARNING = 'warning'; public const LEVEL_WARNING = 'warning';
const LEVEL_ERROR = 'error'; public const LEVEL_ERROR = 'error';
/** /**
* @var string * @var string
@ -25,7 +25,6 @@ class DisplayException extends PterodactylException
* Exception constructor. * Exception constructor.
* *
* @param string $message * @param string $message
* @param Throwable|null $previous
* @param string $level * @param string $level
* @param int $code * @param int $code
*/ */
@ -58,6 +57,7 @@ class DisplayException extends PterodactylException
* request originated from an API hit, return the error in JSONAPI spec format. * request originated from an API hit, return the error in JSONAPI spec format.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
*/ */
public function render($request) public function render($request)

View File

@ -112,7 +112,7 @@ class Handler extends ExceptionHandler
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param \Throwable $exception *
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
* *
* @throws \Throwable * @throws \Throwable
@ -142,7 +142,7 @@ class Handler extends ExceptionHandler
* calls to the API. * calls to the API.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param \Illuminate\Validation\ValidationException $exception *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function invalidJson($request, ValidationException $exception) public function invalidJson($request, ValidationException $exception)
@ -162,7 +162,8 @@ class Handler extends ExceptionHandler
$meta = [ $meta = [
'source_field' => $field, 'source_field' => $field,
'rule' => str_replace(self::PTERODACTYL_RULE_STRING, 'p_', Arr::get( 'rule' => str_replace(self::PTERODACTYL_RULE_STRING, 'p_', Arr::get(
$codes, str_replace('.', '_', $field) . '.' . $key $codes,
str_replace('.', '_', $field) . '.' . $key
)), )),
]; ];
@ -183,10 +184,6 @@ class Handler extends ExceptionHandler
/** /**
* Return the exception as a JSONAPI representation for use on API requests. * Return the exception as a JSONAPI representation for use on API requests.
*
* @param \Throwable $exception
* @param array $override
* @return array
*/ */
public static function convertToArray(Throwable $exception, array $override = []): array public static function convertToArray(Throwable $exception, array $override = []): array
{ {
@ -225,9 +222,6 @@ class Handler extends ExceptionHandler
/** /**
* Return an array of exceptions that should not be reported. * Return an array of exceptions that should not be reported.
*
* @param \Exception $exception
* @return bool
*/ */
public static function isReportable(Exception $exception): bool public static function isReportable(Exception $exception): bool
{ {
@ -238,7 +232,7 @@ class Handler extends ExceptionHandler
* Convert an authentication exception into an unauthenticated response. * Convert an authentication exception into an unauthenticated response.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception *
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
*/ */
protected function unauthenticated($request, AuthenticationException $exception) protected function unauthenticated($request, AuthenticationException $exception)
@ -254,7 +248,6 @@ class Handler extends ExceptionHandler
* Converts an exception into an array to render in the response. Overrides * Converts an exception into an array to render in the response. Overrides
* Laravel's built-in converter to output as a JSONAPI spec compliant object. * Laravel's built-in converter to output as a JSONAPI spec compliant object.
* *
* @param \Throwable $exception
* @return array * @return array
*/ */
protected function convertExceptionToArray(Throwable $exception) protected function convertExceptionToArray(Throwable $exception)

View File

@ -19,9 +19,6 @@ class DaemonConnectionException extends DisplayException
/** /**
* Throw a displayable exception caused by a daemon connection error. * Throw a displayable exception caused by a daemon connection error.
*
* @param \GuzzleHttp\Exception\GuzzleException $previous
* @param bool $useStatusCode
*/ */
public function __construct(GuzzleException $previous, bool $useStatusCode = true) public function __construct(GuzzleException $previous, bool $useStatusCode = true)
{ {

View File

@ -9,9 +9,6 @@ class HttpForbiddenException extends HttpException
{ {
/** /**
* HttpForbiddenException constructor. * HttpForbiddenException constructor.
*
* @param string|null $message
* @param \Throwable|null $previous
*/ */
public function __construct(string $message = null, \Throwable $previous = null) public function __construct(string $message = null, \Throwable $previous = null)
{ {

View File

@ -11,8 +11,6 @@ class TwoFactorAuthRequiredException extends HttpException implements HttpExcept
{ {
/** /**
* TwoFactorAuthRequiredException constructor. * TwoFactorAuthRequiredException constructor.
*
* @param \Throwable|null $previous
*/ */
public function __construct(Throwable $previous = null) public function __construct(Throwable $previous = null)
{ {

View File

@ -18,8 +18,6 @@ class DataValidationException extends PterodactylException implements HttpExcept
/** /**
* DataValidationException constructor. * DataValidationException constructor.
*
* @param \Illuminate\Contracts\Validation\Validator $validator
*/ */
public function __construct(Validator $validator) public function __construct(Validator $validator)
{ {

View File

@ -8,8 +8,6 @@ class TooManyBackupsException extends DisplayException
{ {
/** /**
* TooManyBackupsException constructor. * TooManyBackupsException constructor.
*
* @param int $backupLimit
*/ */
public function __construct(int $backupLimit) public function __construct(int $backupLimit)
{ {

View File

@ -10,9 +10,6 @@ class ServiceLimitExceededException extends DisplayException
/** /**
* Exception thrown when something goes over a defined limit, such as allocated * Exception thrown when something goes over a defined limit, such as allocated
* ports, tasks, databases, etc. * ports, tasks, databases, etc.
*
* @param string $message
* @param \Throwable|null $previous
*/ */
public function __construct(string $message, Throwable $previous = null) public function __construct(string $message, Throwable $previous = null)
{ {

View File

@ -42,8 +42,6 @@ class BackupManager
/** /**
* BackupManager constructor. * BackupManager constructor.
*
* @param \Illuminate\Foundation\Application $app
*/ */
public function __construct(Application $app) public function __construct(Application $app)
{ {
@ -54,7 +52,6 @@ class BackupManager
/** /**
* Returns a backup adapter instance. * Returns a backup adapter instance.
* *
* @param string|null $name
* @return \League\Flysystem\AdapterInterface * @return \League\Flysystem\AdapterInterface
*/ */
public function adapter(string $name = null) public function adapter(string $name = null)
@ -65,8 +62,8 @@ class BackupManager
/** /**
* Set the given backup adapter instance. * Set the given backup adapter instance.
* *
* @param string $name
* @param \League\Flysystem\AdapterInterface $disk * @param \League\Flysystem\AdapterInterface $disk
*
* @return $this * @return $this
*/ */
public function set(string $name, $disk) public function set(string $name, $disk)
@ -79,7 +76,6 @@ class BackupManager
/** /**
* Gets a backup adapter. * Gets a backup adapter.
* *
* @param string $name
* @return \League\Flysystem\AdapterInterface * @return \League\Flysystem\AdapterInterface
*/ */
protected function get(string $name) protected function get(string $name)
@ -90,7 +86,6 @@ class BackupManager
/** /**
* Resolve the given backup disk. * Resolve the given backup disk.
* *
* @param string $name
* @return \League\Flysystem\AdapterInterface * @return \League\Flysystem\AdapterInterface
*/ */
protected function resolve(string $name) protected function resolve(string $name)
@ -98,9 +93,7 @@ class BackupManager
$config = $this->getConfig($name); $config = $this->getConfig($name);
if (empty($config['adapter'])) { if (empty($config['adapter'])) {
throw new InvalidArgumentException( throw new InvalidArgumentException("Backup disk [{$name}] does not have a configured adapter.");
"Backup disk [{$name}] does not have a configured adapter."
);
} }
$adapter = $config['adapter']; $adapter = $config['adapter'];
@ -124,7 +117,6 @@ class BackupManager
/** /**
* Calls a custom creator for a given adapter type. * Calls a custom creator for a given adapter type.
* *
* @param array $config
* @return \League\Flysystem\AdapterInterface * @return \League\Flysystem\AdapterInterface
*/ */
protected function callCustomCreator(array $config) protected function callCustomCreator(array $config)
@ -139,7 +131,6 @@ class BackupManager
/** /**
* Creates a new wings adapter. * Creates a new wings adapter.
* *
* @param array $config
* @return \League\Flysystem\AdapterInterface * @return \League\Flysystem\AdapterInterface
*/ */
public function createWingsAdapter(array $config) public function createWingsAdapter(array $config)
@ -150,7 +141,6 @@ class BackupManager
/** /**
* Creates a new S3 adapter. * Creates a new S3 adapter.
* *
* @param array $config
* @return \League\Flysystem\AdapterInterface * @return \League\Flysystem\AdapterInterface
*/ */
public function createS3Adapter(array $config) public function createS3Adapter(array $config)
@ -169,7 +159,6 @@ class BackupManager
/** /**
* Returns the configuration associated with a given backup type. * Returns the configuration associated with a given backup type.
* *
* @param string $name
* @return array * @return array
*/ */
protected function getConfig(string $name) protected function getConfig(string $name)
@ -189,8 +178,6 @@ class BackupManager
/** /**
* Set the default session driver name. * Set the default session driver name.
*
* @param string $name
*/ */
public function setDefaultAdapter(string $name) public function setDefaultAdapter(string $name)
{ {
@ -201,6 +188,7 @@ class BackupManager
* Unset the given adapter instances. * Unset the given adapter instances.
* *
* @param string|string[] $adapter * @param string|string[] $adapter
*
* @return $this * @return $this
*/ */
public function forget($adapter) public function forget($adapter)
@ -215,8 +203,6 @@ class BackupManager
/** /**
* Register a custom adapter creator closure. * Register a custom adapter creator closure.
* *
* @param string $adapter
* @param \Closure $callback
* @return $this * @return $this
*/ */
public function extend(string $adapter, Closure $callback) public function extend(string $adapter, Closure $callback)

View File

@ -16,9 +16,9 @@ use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface;
class DynamicDatabaseConnection class DynamicDatabaseConnection
{ {
const DB_CHARSET = 'utf8'; public const DB_CHARSET = 'utf8';
const DB_COLLATION = 'utf8_unicode_ci'; public const DB_COLLATION = 'utf8_unicode_ci';
const DB_DRIVER = 'mysql'; public const DB_DRIVER = 'mysql';
/** /**
* @var \Illuminate\Config\Repository * @var \Illuminate\Config\Repository
@ -37,10 +37,6 @@ class DynamicDatabaseConnection
/** /**
* DynamicDatabaseConnection constructor. * DynamicDatabaseConnection constructor.
*
* @param \Illuminate\Config\Repository $config
* @param \Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface $repository
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
*/ */
public function __construct( public function __construct(
ConfigRepository $config, ConfigRepository $config,

View File

@ -13,9 +13,6 @@ final class TimestampDates implements ClaimsFormatter
* by Wings and will cause a flood of errors and panic conditions because the times * by Wings and will cause a flood of errors and panic conditions because the times
* cannot be parsed correctly. The default is time with microseconds, we just need * cannot be parsed correctly. The default is time with microseconds, we just need
* to use the normal unix timestamp here. * to use the normal unix timestamp here.
*
* @param array $claims
* @return array
*/ */
public function formatClaims(array $claims): array public function formatClaims(array $claims): array
{ {

View File

@ -10,7 +10,7 @@ class PterodactylSerializer extends ArraySerializer
* Serialize an item. * Serialize an item.
* *
* @param string $resourceKey * @param string $resourceKey
* @param array $data *
* @return array * @return array
*/ */
public function item($resourceKey, array $data) public function item($resourceKey, array $data)
@ -25,7 +25,7 @@ class PterodactylSerializer extends ArraySerializer
* Serialize a collection. * Serialize a collection.
* *
* @param string $resourceKey * @param string $resourceKey
* @param array $data *
* @return array * @return array
*/ */
public function collection($resourceKey, array $data) public function collection($resourceKey, array $data)
@ -59,6 +59,7 @@ class PterodactylSerializer extends ArraySerializer
* *
* @param array $transformedData * @param array $transformedData
* @param array $includedData * @param array $includedData
*
* @return array * @return array
*/ */
public function mergeIncludes($transformedData, $includedData) public function mergeIncludes($transformedData, $includedData)

View File

@ -22,7 +22,7 @@ class Fractal extends SpatieFractal
{ {
// Set the serializer by default. // Set the serializer by default.
if (is_null($this->serializer)) { if (is_null($this->serializer)) {
$this->serializer = new PterodactylSerializer; $this->serializer = new PterodactylSerializer();
} }
// Automatically set the paginator on the response object if the // Automatically set the paginator on the response object if the

View File

@ -12,9 +12,6 @@ final class Time
* for named timezones in MySQL. * for named timezones in MySQL.
* *
* Returns the timezone as a string like +08:00 or -05:00 depending on the app timezone. * Returns the timezone as a string like +08:00 or -05:00 depending on the app timezone.
*
* @param string $timezone
* @return string
*/ */
public static function getMySQLTimezoneOffset(string $timezone): string public static function getMySQLTimezoneOffset(string $timezone): string
{ {

View File

@ -13,9 +13,6 @@ class Utilities
/** /**
* Generates a random string and injects special characters into it, in addition to * Generates a random string and injects special characters into it, in addition to
* the randomness of the alpha-numeric default response. * the randomness of the alpha-numeric default response.
*
* @param int $length
* @return string
*/ */
public static function randomStringWithSpecialCharacters(int $length = 16): string public static function randomStringWithSpecialCharacters(int $length = 16): string
{ {
@ -23,7 +20,7 @@ class Utilities
// Given a random string of characters, randomly loop through the characters and replace some // Given a random string of characters, randomly loop through the characters and replace some
// with special characters to avoid issues with MySQL password requirements on some servers. // with special characters to avoid issues with MySQL password requirements on some servers.
try { try {
for ($i = 0; $i < random_int(2, 6); $i++) { for ($i = 0; $i < random_int(2, 6); ++$i) {
$character = ['!', '@', '=', '.', '+', '^'][random_int(0, 5)]; $character = ['!', '@', '=', '.', '+', '^'][random_int(0, 5)];
$string = substr_replace($string, $character, random_int(0, $length - 1), 1); $string = substr_replace($string, $character, random_int(0, $length - 1), 1);
@ -39,11 +36,6 @@ class Utilities
/** /**
* Converts schedule cron data into a carbon object. * Converts schedule cron data into a carbon object.
* *
* @param string $minute
* @param string $hour
* @param string $dayOfMonth
* @param string $month
* @param string $dayOfWeek
* @return \Carbon\Carbon * @return \Carbon\Carbon
*/ */
public static function getScheduleNextRunDate(string $minute, string $hour, string $dayOfMonth, string $month, string $dayOfWeek) public static function getScheduleNextRunDate(string $minute, string $hour, string $dayOfMonth, string $month, string $dayOfWeek)
@ -54,8 +46,8 @@ class Utilities
} }
/** /**
* @param string $name
* @param mixed $default * @param mixed $default
*
* @return string * @return string
*/ */
public static function checked(string $name, $default) public static function checked(string $name, $default)

View File

@ -33,10 +33,6 @@ class ApiController extends Controller
/** /**
* ApplicationApiController constructor. * ApplicationApiController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface $repository
* @param \Pterodactyl\Services\Api\KeyCreationService $keyCreationService
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -50,9 +46,6 @@ class ApiController extends Controller
/** /**
* Render view showing all of a user's application API keys. * Render view showing all of a user's application API keys.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\View\View
*/ */
public function index(Request $request): View public function index(Request $request): View
{ {
@ -64,7 +57,6 @@ class ApiController extends Controller
/** /**
* Render view allowing an admin to create a new application API key. * Render view allowing an admin to create a new application API key.
* *
* @return \Illuminate\View\View
* @throws \ReflectionException * @throws \ReflectionException
*/ */
public function create(): View public function create(): View
@ -85,9 +77,6 @@ class ApiController extends Controller
/** /**
* Store the new key and redirect the user back to the application key listing. * Store the new key and redirect the user back to the application key listing.
* *
* @param \Pterodactyl\Http\Requests\Admin\Api\StoreApplicationApiKeyRequest $request
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/ */
public function store(StoreApplicationApiKeyRequest $request): RedirectResponse public function store(StoreApplicationApiKeyRequest $request): RedirectResponse
@ -104,10 +93,6 @@ class ApiController extends Controller
/** /**
* Delete an application API key from the database. * Delete an application API key from the database.
*
* @param \Illuminate\Http\Request $request
* @param string $identifier
* @return \Illuminate\Http\Response
*/ */
public function delete(Request $request, string $identifier): Response public function delete(Request $request, string $identifier): Response
{ {

View File

@ -15,8 +15,6 @@ class BaseController extends Controller
/** /**
* BaseController constructor. * BaseController constructor.
*
* @param \Pterodactyl\Services\Helpers\SoftwareVersionService $version
*/ */
public function __construct(SoftwareVersionService $version) public function __construct(SoftwareVersionService $version)
{ {
@ -25,8 +23,6 @@ class BaseController extends Controller
/** /**
* Return the admin index view. * Return the admin index view.
*
* @return \Illuminate\View\View
*/ */
public function index(): View public function index(): View
{ {

View File

@ -56,14 +56,6 @@ class DatabaseController extends Controller
/** /**
* DatabaseController constructor. * DatabaseController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface $repository
* @param \Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface $databaseRepository
* @param \Pterodactyl\Services\Databases\Hosts\HostCreationService $creationService
* @param \Pterodactyl\Services\Databases\Hosts\HostDeletionService $deletionService
* @param \Pterodactyl\Services\Databases\Hosts\HostUpdateService $updateService
* @param \Pterodactyl\Contracts\Repository\LocationRepositoryInterface $locationRepository
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -85,8 +77,6 @@ class DatabaseController extends Controller
/** /**
* Display database host index. * Display database host index.
*
* @return \Illuminate\View\View
*/ */
public function index(): View public function index(): View
{ {
@ -99,9 +89,6 @@ class DatabaseController extends Controller
/** /**
* Display database host to user. * Display database host to user.
* *
* @param int $host
* @return \Illuminate\View\View
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function view(int $host): View public function view(int $host): View
@ -116,9 +103,6 @@ class DatabaseController extends Controller
/** /**
* Handle request to create a new database host. * Handle request to create a new database host.
* *
* @param \Pterodactyl\Http\Requests\Admin\DatabaseHostFormRequest $request
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Throwable * @throws \Throwable
*/ */
public function create(DatabaseHostFormRequest $request): RedirectResponse public function create(DatabaseHostFormRequest $request): RedirectResponse
@ -145,10 +129,6 @@ class DatabaseController extends Controller
/** /**
* Handle updating database host. * Handle updating database host.
* *
* @param \Pterodactyl\Http\Requests\Admin\DatabaseHostFormRequest $request
* @param \Pterodactyl\Models\DatabaseHost $host
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Throwable * @throws \Throwable
*/ */
public function update(DatabaseHostFormRequest $request, DatabaseHost $host): RedirectResponse public function update(DatabaseHostFormRequest $request, DatabaseHost $host): RedirectResponse
@ -178,9 +158,6 @@ class DatabaseController extends Controller
/** /**
* Handle request to delete a database host. * Handle request to delete a database host.
* *
* @param int $host
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\Service\HasActiveServersException * @throws \Pterodactyl\Exceptions\Service\HasActiveServersException
*/ */
public function delete(int $host): RedirectResponse public function delete(int $host): RedirectResponse

View File

@ -48,12 +48,6 @@ class LocationController extends Controller
/** /**
* LocationController constructor. * LocationController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Services\Locations\LocationCreationService $creationService
* @param \Pterodactyl\Services\Locations\LocationDeletionService $deletionService
* @param \Pterodactyl\Contracts\Repository\LocationRepositoryInterface $repository
* @param \Pterodactyl\Services\Locations\LocationUpdateService $updateService
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -85,6 +79,7 @@ class LocationController extends Controller
* Return the location view page. * Return the location view page.
* *
* @param int $id * @param int $id
*
* @return \Illuminate\View\View * @return \Illuminate\View\View
* *
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@ -99,7 +94,6 @@ class LocationController extends Controller
/** /**
* Handle request to create new location. * Handle request to create new location.
* *
* @param \Pterodactyl\Http\Requests\Admin\LocationFormRequest $request
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Throwable * @throws \Throwable
@ -115,8 +109,6 @@ class LocationController extends Controller
/** /**
* Handle request to update or delete location. * Handle request to update or delete location.
* *
* @param \Pterodactyl\Http\Requests\Admin\LocationFormRequest $request
* @param \Pterodactyl\Models\Location $location
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Throwable * @throws \Throwable
@ -136,7 +128,6 @@ class LocationController extends Controller
/** /**
* Delete a location from the system. * Delete a location from the system.
* *
* @param \Pterodactyl\Models\Location $location
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Exception * @throws \Exception

View File

@ -38,11 +38,6 @@ class MountController extends Controller
/** /**
* MountController constructor. * MountController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Contracts\Repository\NestRepositoryInterface $nestRepository
* @param \Pterodactyl\Contracts\Repository\LocationRepositoryInterface $locationRepository
* @param \Pterodactyl\Repositories\Eloquent\MountRepository $repository
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -72,6 +67,7 @@ class MountController extends Controller
* Return the mount view page. * Return the mount view page.
* *
* @param string $id * @param string $id
*
* @return \Illuminate\View\View * @return \Illuminate\View\View
* *
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@ -91,7 +87,6 @@ class MountController extends Controller
/** /**
* Handle request to create new mount. * Handle request to create new mount.
* *
* @param \Pterodactyl\Http\Requests\Admin\MountFormRequest $request
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Throwable * @throws \Throwable
@ -112,8 +107,6 @@ class MountController extends Controller
/** /**
* Handle request to update or delete location. * Handle request to update or delete location.
* *
* @param \Pterodactyl\Http\Requests\Admin\MountFormRequest $request
* @param \Pterodactyl\Models\Mount $mount
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Throwable * @throws \Throwable
@ -134,7 +127,6 @@ class MountController extends Controller
/** /**
* Delete a location from the system. * Delete a location from the system.
* *
* @param \Pterodactyl\Models\Mount $mount
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Exception * @throws \Exception
@ -149,8 +141,6 @@ class MountController extends Controller
/** /**
* Adds eggs to the mount's many to many relation. * Adds eggs to the mount's many to many relation.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Mount $mount
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function addEggs(Request $request, Mount $mount) public function addEggs(Request $request, Mount $mount)
@ -172,8 +162,6 @@ class MountController extends Controller
/** /**
* Adds nodes to the mount's many to many relation. * Adds nodes to the mount's many to many relation.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Mount $mount
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function addNodes(Request $request, Mount $mount) public function addNodes(Request $request, Mount $mount)
@ -193,8 +181,6 @@ class MountController extends Controller
/** /**
* Deletes an egg from the mount's many to many relation. * Deletes an egg from the mount's many to many relation.
* *
* @param \Pterodactyl\Models\Mount $mount
* @param int $egg_id
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function deleteEgg(Mount $mount, int $egg_id) public function deleteEgg(Mount $mount, int $egg_id)
@ -207,8 +193,6 @@ class MountController extends Controller
/** /**
* Deletes an node from the mount's many to many relation. * Deletes an node from the mount's many to many relation.
* *
* @param \Pterodactyl\Models\Mount $mount
* @param int $node_id
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function deleteNode(Mount $mount, int $node_id) public function deleteNode(Mount $mount, int $node_id)

View File

@ -55,8 +55,6 @@ class EggController extends Controller
/** /**
* Handle a request to display the Egg creation page. * Handle a request to display the Egg creation page.
* *
* @return \Illuminate\View\View
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function create(): View public function create(): View
@ -70,9 +68,6 @@ class EggController extends Controller
/** /**
* Handle request to store a new Egg. * Handle request to store a new Egg.
* *
* @param \Pterodactyl\Http\Requests\Admin\Egg\EggFormRequest $request
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Service\Egg\NoParentConfigurationFoundException * @throws \Pterodactyl\Exceptions\Service\Egg\NoParentConfigurationFoundException
*/ */
@ -93,9 +88,6 @@ class EggController extends Controller
/** /**
* Handle request to view a single Egg. * Handle request to view a single Egg.
*
* @param \Pterodactyl\Models\Egg $egg
* @return \Illuminate\View\View
*/ */
public function view(Egg $egg): View public function view(Egg $egg): View
{ {
@ -105,10 +97,6 @@ class EggController extends Controller
/** /**
* Handle request to update an Egg. * Handle request to update an Egg.
* *
* @param \Pterodactyl\Http\Requests\Admin\Egg\EggFormRequest $request
* @param \Pterodactyl\Models\Egg $egg
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
* @throws \Pterodactyl\Exceptions\Service\Egg\NoParentConfigurationFoundException * @throws \Pterodactyl\Exceptions\Service\Egg\NoParentConfigurationFoundException
@ -131,9 +119,6 @@ class EggController extends Controller
/** /**
* Handle request to destroy an egg. * Handle request to destroy an egg.
* *
* @param \Pterodactyl\Models\Egg $egg
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\Service\Egg\HasChildrenException * @throws \Pterodactyl\Exceptions\Service\Egg\HasChildrenException
* @throws \Pterodactyl\Exceptions\Service\HasActiveServersException * @throws \Pterodactyl\Exceptions\Service\HasActiveServersException
*/ */

View File

@ -30,10 +30,6 @@ class EggScriptController extends Controller
/** /**
* EggScriptController constructor. * EggScriptController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Contracts\Repository\EggRepositoryInterface $repository
* @param \Pterodactyl\Services\Eggs\Scripts\InstallScriptService $installScriptService
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -47,9 +43,6 @@ class EggScriptController extends Controller
/** /**
* Handle requests to render installation script for an Egg. * Handle requests to render installation script for an Egg.
*
* @param int $egg
* @return \Illuminate\View\View
*/ */
public function index(int $egg): View public function index(int $egg): View
{ {
@ -74,10 +67,6 @@ class EggScriptController extends Controller
/** /**
* Handle a request to update the installation script for an Egg. * Handle a request to update the installation script for an Egg.
* *
* @param \Pterodactyl\Http\Requests\Admin\Egg\EggScriptFormRequest $request
* @param \Pterodactyl\Models\Egg $egg
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
* @throws \Pterodactyl\Exceptions\Service\Egg\InvalidCopyFromException * @throws \Pterodactyl\Exceptions\Service\Egg\InvalidCopyFromException

View File

@ -43,11 +43,6 @@ class EggShareController extends Controller
/** /**
* OptionShareController constructor. * OptionShareController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Services\Eggs\Sharing\EggExporterService $exporterService
* @param \Pterodactyl\Services\Eggs\Sharing\EggImporterService $importerService
* @param \Pterodactyl\Services\Eggs\Sharing\EggUpdateImporterService $updateImporterService
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -62,9 +57,6 @@ class EggShareController extends Controller
} }
/** /**
* @param \Pterodactyl\Models\Egg $egg
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function export(Egg $egg): Response public function export(Egg $egg): Response
@ -82,9 +74,6 @@ class EggShareController extends Controller
/** /**
* Import a new service option using an XML file. * Import a new service option using an XML file.
* *
* @param \Pterodactyl\Http\Requests\Admin\Egg\EggImportFormRequest $request
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
* @throws \Pterodactyl\Exceptions\Service\Egg\BadJsonFormatException * @throws \Pterodactyl\Exceptions\Service\Egg\BadJsonFormatException
@ -101,10 +90,6 @@ class EggShareController extends Controller
/** /**
* Update an existing Egg using a new imported file. * Update an existing Egg using a new imported file.
* *
* @param \Pterodactyl\Http\Requests\Admin\Egg\EggImportFormRequest $request
* @param \Pterodactyl\Models\Egg $egg
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
* @throws \Pterodactyl\Exceptions\Service\Egg\BadJsonFormatException * @throws \Pterodactyl\Exceptions\Service\Egg\BadJsonFormatException

View File

@ -50,12 +50,6 @@ class EggVariableController extends Controller
/** /**
* EggVariableController constructor. * EggVariableController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Services\Eggs\Variables\VariableCreationService $creationService
* @param \Pterodactyl\Services\Eggs\Variables\VariableUpdateService $updateService
* @param \Pterodactyl\Contracts\Repository\EggRepositoryInterface $repository
* @param \Pterodactyl\Contracts\Repository\EggVariableRepositoryInterface $variableRepository
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -74,9 +68,6 @@ class EggVariableController extends Controller
/** /**
* Handle request to view the variables attached to an Egg. * Handle request to view the variables attached to an Egg.
* *
* @param int $egg
* @return \Illuminate\View\View
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function view(int $egg): View public function view(int $egg): View
@ -89,10 +80,6 @@ class EggVariableController extends Controller
/** /**
* Handle a request to create a new Egg variable. * Handle a request to create a new Egg variable.
* *
* @param \Pterodactyl\Http\Requests\Admin\Egg\EggVariableFormRequest $request
* @param \Pterodactyl\Models\Egg $egg
*
* @return \Illuminate\Http\RedirectResponse
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Service\Egg\Variable\BadValidationRuleException * @throws \Pterodactyl\Exceptions\Service\Egg\Variable\BadValidationRuleException
* @throws \Pterodactyl\Exceptions\Service\Egg\Variable\ReservedVariableNameException * @throws \Pterodactyl\Exceptions\Service\Egg\Variable\ReservedVariableNameException
@ -108,11 +95,6 @@ class EggVariableController extends Controller
/** /**
* Handle a request to update an existing Egg variable. * Handle a request to update an existing Egg variable.
* *
* @param \Pterodactyl\Http\Requests\Admin\Egg\EggVariableFormRequest $request
* @param \Pterodactyl\Models\Egg $egg
* @param \Pterodactyl\Models\EggVariable $variable
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@ -130,10 +112,6 @@ class EggVariableController extends Controller
/** /**
* Handle a request to delete an existing Egg variable from the Panel. * Handle a request to delete an existing Egg variable from the Panel.
*
* @param int $egg
* @param \Pterodactyl\Models\EggVariable $variable
* @return \Illuminate\Http\RedirectResponse
*/ */
public function destroy(int $egg, EggVariable $variable): RedirectResponse public function destroy(int $egg, EggVariable $variable): RedirectResponse
{ {

View File

@ -48,12 +48,6 @@ class NestController extends Controller
/** /**
* NestController constructor. * NestController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Services\Nests\NestCreationService $nestCreationService
* @param \Pterodactyl\Services\Nests\NestDeletionService $nestDeletionService
* @param \Pterodactyl\Contracts\Repository\NestRepositoryInterface $repository
* @param \Pterodactyl\Services\Nests\NestUpdateService $nestUpdateService
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -72,8 +66,6 @@ class NestController extends Controller
/** /**
* Render nest listing page. * Render nest listing page.
* *
* @return \Illuminate\View\View
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function index(): View public function index(): View
@ -85,8 +77,6 @@ class NestController extends Controller
/** /**
* Render nest creation page. * Render nest creation page.
*
* @return \Illuminate\View\View
*/ */
public function create(): View public function create(): View
{ {
@ -96,9 +86,6 @@ class NestController extends Controller
/** /**
* Handle the storage of a new nest. * Handle the storage of a new nest.
* *
* @param \Pterodactyl\Http\Requests\Admin\Nest\StoreNestFormRequest $request
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/ */
public function store(StoreNestFormRequest $request): RedirectResponse public function store(StoreNestFormRequest $request): RedirectResponse
@ -112,9 +99,6 @@ class NestController extends Controller
/** /**
* Return details about a nest including all of the eggs and servers per egg. * Return details about a nest including all of the eggs and servers per egg.
* *
* @param int $nest
* @return \Illuminate\View\View
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function view(int $nest): View public function view(int $nest): View
@ -127,10 +111,6 @@ class NestController extends Controller
/** /**
* Handle request to update a nest. * Handle request to update a nest.
* *
* @param \Pterodactyl\Http\Requests\Admin\Nest\StoreNestFormRequest $request
* @param int $nest
*
* @return \Illuminate\Http\RedirectResponse
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
@ -145,9 +125,6 @@ class NestController extends Controller
/** /**
* Handle request to delete a nest. * Handle request to delete a nest.
* *
* @param int $nest
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Pterodactyl\Exceptions\Service\HasActiveServersException * @throws \Pterodactyl\Exceptions\Service\HasActiveServersException
*/ */
public function destroy(int $nest): RedirectResponse public function destroy(int $nest): RedirectResponse

View File

@ -30,10 +30,6 @@ class NodeAutoDeployController extends Controller
/** /**
* NodeAutoDeployController constructor. * NodeAutoDeployController constructor.
*
* @param \Pterodactyl\Repositories\Eloquent\ApiKeyRepository $repository
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
* @param \Pterodactyl\Services\Api\KeyCreationService $keyCreationService
*/ */
public function __construct( public function __construct(
ApiKeyRepository $repository, ApiKeyRepository $repository,
@ -49,8 +45,6 @@ class NodeAutoDeployController extends Controller
* Generates a new API key for the logged in user with only permission to read * Generates a new API key for the logged in user with only permission to read
* nodes, and returns that as the deployment key for a node. * nodes, and returns that as the deployment key for a node.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
* *
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException

View File

@ -23,9 +23,6 @@ class NodeController extends Controller
/** /**
* NodeController constructor. * NodeController constructor.
*
* @param \Pterodactyl\Repositories\Eloquent\NodeRepository $repository
* @param \Illuminate\Contracts\View\Factory $view
*/ */
public function __construct(NodeRepository $repository, Factory $view) public function __construct(NodeRepository $repository, Factory $view)
{ {
@ -36,7 +33,6 @@ class NodeController extends Controller
/** /**
* Returns a listing of nodes on the system. * Returns a listing of nodes on the system.
* *
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function index(Request $request) public function index(Request $request)

View File

@ -51,13 +51,6 @@ class NodeViewController extends Controller
/** /**
* NodeViewController constructor. * NodeViewController constructor.
*
* @param \Pterodactyl\Repositories\Eloquent\AllocationRepository $allocationRepository
* @param \Pterodactyl\Repositories\Eloquent\LocationRepository $locationRepository
* @param \Pterodactyl\Repositories\Eloquent\NodeRepository $repository
* @param \Pterodactyl\Repositories\Eloquent\ServerRepository $serverRepository
* @param \Pterodactyl\Services\Helpers\SoftwareVersionService $versionService
* @param \Illuminate\Contracts\View\Factory $view
*/ */
public function __construct( public function __construct(
AllocationRepository $allocationRepository, AllocationRepository $allocationRepository,
@ -78,8 +71,6 @@ class NodeViewController extends Controller
/** /**
* Returns index view for a specific node on the system. * Returns index view for a specific node on the system.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function index(Request $request, Node $node) public function index(Request $request, Node $node)
@ -96,8 +87,6 @@ class NodeViewController extends Controller
/** /**
* Returns the settings page for a specific node. * Returns the settings page for a specific node.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function settings(Request $request, Node $node) public function settings(Request $request, Node $node)
@ -111,8 +100,6 @@ class NodeViewController extends Controller
/** /**
* Return the node configuration page for a specific node. * Return the node configuration page for a specific node.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function configuration(Request $request, Node $node) public function configuration(Request $request, Node $node)
@ -123,8 +110,6 @@ class NodeViewController extends Controller
/** /**
* Return the node allocation management page. * Return the node allocation management page.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function allocations(Request $request, Node $node) public function allocations(Request $request, Node $node)
@ -145,8 +130,6 @@ class NodeViewController extends Controller
/** /**
* Return a listing of servers that exist for this specific node. * Return a listing of servers that exist for this specific node.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function servers(Request $request, Node $node) public function servers(Request $request, Node $node)

View File

@ -18,8 +18,6 @@ class SystemInformationController extends Controller
/** /**
* SystemInformationController constructor. * SystemInformationController constructor.
*
* @param \Pterodactyl\Repositories\Wings\DaemonConfigurationRepository $repository
*/ */
public function __construct(DaemonConfigurationRepository $repository) public function __construct(DaemonConfigurationRepository $repository)
{ {
@ -29,8 +27,6 @@ class SystemInformationController extends Controller
/** /**
* Returns system information from the Daemon. * Returns system information from the Daemon.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
* *
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException * @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException

View File

@ -94,19 +94,6 @@ class NodesController extends Controller
/** /**
* NodesController constructor. * NodesController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Services\Allocations\AllocationDeletionService $allocationDeletionService
* @param \Pterodactyl\Contracts\Repository\AllocationRepositoryInterface $allocationRepository
* @param \Pterodactyl\Services\Allocations\AssignmentService $assignmentService
* @param \Illuminate\Cache\Repository $cache
* @param \Pterodactyl\Services\Nodes\NodeCreationService $creationService
* @param \Pterodactyl\Services\Nodes\NodeDeletionService $deletionService
* @param \Pterodactyl\Contracts\Repository\LocationRepositoryInterface $locationRepository
* @param \Pterodactyl\Contracts\Repository\NodeRepositoryInterface $repository
* @param \Pterodactyl\Contracts\Repository\ServerRepositoryInterface $serverRepository
* @param \Pterodactyl\Services\Nodes\NodeUpdateService $updateService
* @param \Pterodactyl\Services\Helpers\SoftwareVersionService $versionService
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -156,7 +143,6 @@ class NodesController extends Controller
/** /**
* Post controller to create a new node on the system. * Post controller to create a new node on the system.
* *
* @param \Pterodactyl\Http\Requests\Admin\Node\NodeFormRequest $request
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -172,8 +158,6 @@ class NodesController extends Controller
/** /**
* Updates settings for a node. * Updates settings for a node.
* *
* @param \Pterodactyl\Http\Requests\Admin\Node\NodeFormRequest $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException
@ -191,10 +175,6 @@ class NodesController extends Controller
/** /**
* Removes a single allocation from a node. * Removes a single allocation from a node.
* *
* @param int $node
* @param \Pterodactyl\Models\Allocation $allocation
* @return \Illuminate\Http\Response
*
* @throws \Pterodactyl\Exceptions\Service\Allocation\ServerUsingAllocationException * @throws \Pterodactyl\Exceptions\Service\Allocation\ServerUsingAllocationException
*/ */
public function allocationRemoveSingle(int $node, Allocation $allocation): Response public function allocationRemoveSingle(int $node, Allocation $allocation): Response
@ -207,10 +187,6 @@ class NodesController extends Controller
/** /**
* Removes multiple individual allocations from a node. * Removes multiple individual allocations from a node.
* *
* @param \Illuminate\Http\Request $request
* @param int $node
* @return \Illuminate\Http\Response
*
* @throws \Pterodactyl\Exceptions\Service\Allocation\ServerUsingAllocationException * @throws \Pterodactyl\Exceptions\Service\Allocation\ServerUsingAllocationException
*/ */
public function allocationRemoveMultiple(Request $request, int $node): Response public function allocationRemoveMultiple(Request $request, int $node): Response
@ -228,8 +204,8 @@ class NodesController extends Controller
/** /**
* Remove all allocations for a specific IP at once on a node. * Remove all allocations for a specific IP at once on a node.
* *
* @param \Illuminate\Http\Request $request
* @param int $node * @param int $node
*
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function allocationRemoveBlock(Request $request, $node) public function allocationRemoveBlock(Request $request, $node)
@ -249,7 +225,6 @@ class NodesController extends Controller
/** /**
* Sets an alias for a specific allocation on a node. * Sets an alias for a specific allocation on a node.
* *
* @param \Pterodactyl\Http\Requests\Admin\Node\AllocationAliasFormRequest $request
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
* *
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -267,8 +242,8 @@ class NodesController extends Controller
/** /**
* Creates new allocations on a node. * Creates new allocations on a node.
* *
* @param \Pterodactyl\Http\Requests\Admin\Node\AllocationFormRequest $request
* @param int|\Pterodactyl\Models\Node $node * @param int|\Pterodactyl\Models\Node $node
*
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\Service\Allocation\CidrOutOfRangeException * @throws \Pterodactyl\Exceptions\Service\Allocation\CidrOutOfRangeException
@ -288,6 +263,7 @@ class NodesController extends Controller
* Deletes a node from the system. * Deletes a node from the system.
* *
* @param $node * @param $node
*
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException

View File

@ -47,13 +47,6 @@ class CreateServerController extends Controller
/** /**
* CreateServerController constructor. * CreateServerController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Repositories\Eloquent\NestRepository $nestRepository
* @param \Pterodactyl\Repositories\Eloquent\LocationRepository $locationRepository
* @param \Pterodactyl\Repositories\Eloquent\NodeRepository $nodeRepository
* @param \Pterodactyl\Repositories\Eloquent\ServerRepository $repository
* @param \Pterodactyl\Services\Servers\ServerCreationService $creationService
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -75,6 +68,7 @@ class CreateServerController extends Controller
* Displays the create server page. * Displays the create server page.
* *
* @return \Illuminate\Contracts\View\Factory * @return \Illuminate\Contracts\View\Factory
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
public function index() public function index()
@ -106,7 +100,6 @@ class CreateServerController extends Controller
/** /**
* Create a new server on the remote system. * Create a new server on the remote system.
* *
* @param \Pterodactyl\Http\Requests\Admin\ServerFormRequest $request
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Illuminate\Validation\ValidationException * @throws \Illuminate\Validation\ValidationException

View File

@ -25,9 +25,6 @@ class ServerController extends Controller
/** /**
* ServerController constructor. * ServerController constructor.
*
* @param \Illuminate\Contracts\View\Factory $view
* @param \Pterodactyl\Repositories\Eloquent\ServerRepository $repository
*/ */
public function __construct( public function __construct(
Factory $view, Factory $view,
@ -41,7 +38,6 @@ class ServerController extends Controller
* Returns all of the servers that exist on the system using a paginated result set. If * Returns all of the servers that exist on the system using a paginated result set. If
* a query is passed along in the request it is also passed to the repository function. * a query is passed along in the request it is also passed to the repository function.
* *
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function index(Request $request) public function index(Request $request)
@ -49,7 +45,7 @@ class ServerController extends Controller
$servers = QueryBuilder::for(Server::query()->with('node', 'user', 'allocation')) $servers = QueryBuilder::for(Server::query()->with('node', 'user', 'allocation'))
->allowedFilters([ ->allowedFilters([
AllowedFilter::exact('owner_id'), AllowedFilter::exact('owner_id'),
AllowedFilter::custom('*', new AdminServerFilter), AllowedFilter::custom('*', new AdminServerFilter()),
]) ])
->paginate(config()->get('pterodactyl.paginate.admin.servers')); ->paginate(config()->get('pterodactyl.paginate.admin.servers'));

View File

@ -53,14 +53,6 @@ class ServerTransferController extends Controller
/** /**
* ServerTransferController constructor. * ServerTransferController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Contracts\Repository\AllocationRepositoryInterface $allocationRepository
* @param \Pterodactyl\Repositories\Eloquent\ServerRepository $repository
* @param \Pterodactyl\Repositories\Eloquent\LocationRepository $locationRepository
* @param \Pterodactyl\Repositories\Eloquent\NodeRepository $nodeRepository
* @param \Pterodactyl\Services\Servers\TransferService $transferService
* @param \Pterodactyl\Repositories\Wings\DaemonConfigurationRepository $daemonConfigurationRepository
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -83,8 +75,6 @@ class ServerTransferController extends Controller
/** /**
* Starts a transfer of a server to a new node. * Starts a transfer of a server to a new node.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Throwable * @throws \Throwable
@ -108,7 +98,7 @@ class ServerTransferController extends Controller
$this->daemonConfigurationRepository->setNode($node)->getSystemInformation(); $this->daemonConfigurationRepository->setNode($node)->getSystemInformation();
// Create a new ServerTransfer entry. // Create a new ServerTransfer entry.
$transfer = new ServerTransfer; $transfer = new ServerTransfer();
$transfer->server_id = $server->id; $transfer->server_id = $server->id;
$transfer->old_node = $server->node_id; $transfer->old_node = $server->node_id;
@ -136,11 +126,6 @@ class ServerTransferController extends Controller
/** /**
* Assigns the specified allocations to the specified server. * Assigns the specified allocations to the specified server.
*
* @param Server $server
* @param int $node_id
* @param int $allocation_id
* @param array $additional_allocations
*/ */
private function assignAllocationsToServer(Server $server, int $node_id, int $allocation_id, array $additional_allocations) private function assignAllocationsToServer(Server $server, int $node_id, int $allocation_id, array $additional_allocations)
{ {

View File

@ -64,15 +64,6 @@ class ServerViewController extends Controller
/** /**
* ServerViewController constructor. * ServerViewController constructor.
*
* @param \Illuminate\Contracts\View\Factory $view
* @param \Pterodactyl\Repositories\Eloquent\DatabaseHostRepository $databaseHostRepository
* @param \Pterodactyl\Repositories\Eloquent\LocationRepository $locationRepository
* @param \Pterodactyl\Repositories\Eloquent\MountRepository $mountRepository
* @param \Pterodactyl\Repositories\Eloquent\NestRepository $nestRepository
* @param \Pterodactyl\Repositories\Eloquent\NodeRepository $nodeRepository
* @param \Pterodactyl\Repositories\Eloquent\ServerRepository $repository
* @param \Pterodactyl\Services\Servers\EnvironmentService $environmentService
*/ */
public function __construct( public function __construct(
Factory $view, Factory $view,
@ -97,8 +88,6 @@ class ServerViewController extends Controller
/** /**
* Returns the index view for a server. * Returns the index view for a server.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function index(Request $request, Server $server) public function index(Request $request, Server $server)
@ -109,8 +98,6 @@ class ServerViewController extends Controller
/** /**
* Returns the server details page. * Returns the server details page.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function details(Request $request, Server $server) public function details(Request $request, Server $server)
@ -121,8 +108,6 @@ class ServerViewController extends Controller
/** /**
* Returns a view of server build settings. * Returns a view of server build settings.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function build(Request $request, Server $server) public function build(Request $request, Server $server)
@ -139,8 +124,6 @@ class ServerViewController extends Controller
/** /**
* Returns the server startup management page. * Returns the server startup management page.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
* *
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@ -166,8 +149,6 @@ class ServerViewController extends Controller
/** /**
* Returns all of the databases that exist for the server. * Returns all of the databases that exist for the server.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function database(Request $request, Server $server) public function database(Request $request, Server $server)
@ -181,8 +162,6 @@ class ServerViewController extends Controller
/** /**
* Returns all of the mounts that exist for the server. * Returns all of the mounts that exist for the server.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function mounts(Request $request, Server $server) public function mounts(Request $request, Server $server)
@ -199,8 +178,6 @@ class ServerViewController extends Controller
* Returns the base server management page, or an exception if the server * Returns the base server management page, or an exception if the server
* is in a state that cannot be recovered from. * is in a state that cannot be recovered from.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
* *
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException
@ -208,9 +185,7 @@ class ServerViewController extends Controller
public function manage(Request $request, Server $server) public function manage(Request $request, Server $server)
{ {
if ($server->installed > 1) { if ($server->installed > 1) {
throw new DisplayException( throw new DisplayException('This server is in a failed install state and cannot be recovered. Please delete and re-create the server.');
'This server is in a failed install state and cannot be recovered. Please delete and re-create the server.'
);
} }
// Check if the panel doesn't have at least 2 nodes configured. // Check if the panel doesn't have at least 2 nodes configured.
@ -234,8 +209,6 @@ class ServerViewController extends Controller
/** /**
* Returns the server deletion page. * Returns the server deletion page.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View
*/ */
public function delete(Request $request, Server $server) public function delete(Request $request, Server $server)

View File

@ -132,25 +132,6 @@ class ServersController extends Controller
/** /**
* ServersController constructor. * ServersController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Contracts\Repository\AllocationRepositoryInterface $allocationRepository
* @param \Pterodactyl\Services\Servers\BuildModificationService $buildModificationService
* @param \Illuminate\Contracts\Config\Repository $config
* @param \Pterodactyl\Repositories\Wings\DaemonServerRepository $daemonServerRepository
* @param \Pterodactyl\Services\Databases\DatabaseManagementService $databaseManagementService
* @param \Pterodactyl\Services\Databases\DatabasePasswordService $databasePasswordService
* @param \Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface $databaseRepository
* @param \Pterodactyl\Repositories\Eloquent\DatabaseHostRepository $databaseHostRepository
* @param \Pterodactyl\Services\Servers\ServerDeletionService $deletionService
* @param \Pterodactyl\Services\Servers\DetailsModificationService $detailsModificationService
* @param \Pterodactyl\Services\Servers\ReinstallServerService $reinstallService
* @param \Pterodactyl\Contracts\Repository\ServerRepositoryInterface $repository
* @param \Pterodactyl\Repositories\Eloquent\MountRepository $mountRepository
* @param \Pterodactyl\Contracts\Repository\NestRepositoryInterface $nestRepository
* @param \Pterodactyl\Services\Servers\ServerConfigurationStructureService $serverConfigurationStructureService
* @param \Pterodactyl\Services\Servers\StartupModificationService $startupModificationService
* @param \Pterodactyl\Services\Servers\SuspensionService $suspensionService
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -195,8 +176,6 @@ class ServersController extends Controller
/** /**
* Update the details for a server. * Update the details for a server.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -216,7 +195,6 @@ class ServersController extends Controller
/** /**
* Toggles the install status for a server. * Toggles the install status for a server.
* *
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException
@ -241,7 +219,6 @@ class ServersController extends Controller
/** /**
* Reinstalls the server with the currently assigned service. * Reinstalls the server with the currently assigned service.
* *
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException
@ -259,8 +236,6 @@ class ServersController extends Controller
/** /**
* Manage the suspension status for a server. * Manage the suspension status for a server.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException
@ -280,8 +255,6 @@ class ServersController extends Controller
/** /**
* Update the build configuration for a server. * Update the build configuration for a server.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException
@ -308,8 +281,6 @@ class ServersController extends Controller
/** /**
* Start the server deletion process. * Start the server deletion process.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException
@ -326,8 +297,6 @@ class ServersController extends Controller
/** /**
* Update the startup command as well as variables. * Update the startup command as well as variables.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Illuminate\Validation\ValidationException * @throws \Illuminate\Validation\ValidationException
@ -356,8 +325,6 @@ class ServersController extends Controller
/** /**
* Creates a new database assigned to a specific server. * Creates a new database assigned to a specific server.
* *
* @param \Pterodactyl\Http\Requests\Admin\Servers\Databases\StoreServerDatabaseRequest $request
* @param \Pterodactyl\Models\Server $server
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Throwable * @throws \Throwable
@ -377,8 +344,8 @@ class ServersController extends Controller
/** /**
* Resets the database password for a specific database on this server. * Resets the database password for a specific database on this server.
* *
* @param \Illuminate\Http\Request $request
* @param int $server * @param int $server
*
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Throwable * @throws \Throwable
@ -400,6 +367,7 @@ class ServersController extends Controller
* *
* @param int $server * @param int $server
* @param int $database * @param int $database
*
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Exception * @throws \Exception
@ -420,15 +388,13 @@ class ServersController extends Controller
/** /**
* Add a mount to a server. * Add a mount to a server.
* *
* @param Server $server
* @param \Pterodactyl\Models\Mount $mount
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Throwable * @throws \Throwable
*/ */
public function addMount(Server $server, Mount $mount) public function addMount(Server $server, Mount $mount)
{ {
$mountServer = (new MountServer)->forceFill([ $mountServer = (new MountServer())->forceFill([
'mount_id' => $mount->id, 'mount_id' => $mount->id,
'server_id' => $server->id, 'server_id' => $server->id,
]); ]);
@ -443,8 +409,6 @@ class ServersController extends Controller
/** /**
* Remove a mount from a server. * Remove a mount from a server.
* *
* @param Server $server
* @param \Pterodactyl\Models\Mount $mount
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function deleteMount(Server $server, Mount $mount) public function deleteMount(Server $server, Mount $mount)

View File

@ -35,11 +35,6 @@ class AdvancedController extends Controller
/** /**
* AdvancedController constructor. * AdvancedController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Illuminate\Contracts\Config\Repository $config
* @param \Illuminate\Contracts\Console\Kernel $kernel
* @param \Pterodactyl\Contracts\Repository\SettingsRepositoryInterface $settings
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -55,8 +50,6 @@ class AdvancedController extends Controller
/** /**
* Render advanced Panel settings UI. * Render advanced Panel settings UI.
*
* @return \Illuminate\View\View
*/ */
public function index(): View public function index(): View
{ {
@ -74,8 +67,6 @@ class AdvancedController extends Controller
} }
/** /**
* @param \Pterodactyl\Http\Requests\Admin\Settings\AdvancedSettingsFormRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */

View File

@ -38,17 +38,13 @@ class IndexController extends Controller
/** /**
* IndexController constructor. * IndexController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Illuminate\Contracts\Console\Kernel $kernel
* @param \Pterodactyl\Contracts\Repository\SettingsRepositoryInterface $settings
* @param \Pterodactyl\Services\Helpers\SoftwareVersionService $versionService
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
Kernel $kernel, Kernel $kernel,
SettingsRepositoryInterface $settings, SettingsRepositoryInterface $settings,
SoftwareVersionService $versionService) SoftwareVersionService $versionService
)
{ {
$this->alert = $alert; $this->alert = $alert;
$this->kernel = $kernel; $this->kernel = $kernel;
@ -58,8 +54,6 @@ class IndexController extends Controller
/** /**
* Render the UI for basic Panel settings. * Render the UI for basic Panel settings.
*
* @return \Illuminate\View\View
*/ */
public function index(): View public function index(): View
{ {
@ -72,8 +66,6 @@ class IndexController extends Controller
/** /**
* Handle settings update. * Handle settings update.
* *
* @param \Pterodactyl\Http\Requests\Admin\Settings\BaseSettingsFormRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */

View File

@ -47,12 +47,6 @@ class MailController extends Controller
/** /**
* MailController constructor. * MailController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Illuminate\Contracts\Config\Repository $config
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
* @param \Illuminate\Contracts\Console\Kernel $kernel
* @param \Pterodactyl\Contracts\Repository\SettingsRepositoryInterface $settings
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -71,8 +65,6 @@ class MailController extends Controller
/** /**
* Render UI for editing mail settings. This UI should only display if * Render UI for editing mail settings. This UI should only display if
* the server is configured to send mail using SMTP. * the server is configured to send mail using SMTP.
*
* @return \Illuminate\View\View
*/ */
public function index(): View public function index(): View
{ {
@ -84,9 +76,6 @@ class MailController extends Controller
/** /**
* Handle request to update SMTP mail settings. * Handle request to update SMTP mail settings.
* *
* @param \Pterodactyl\Http\Requests\Admin\Settings\MailSettingsFormRequest $request
* @return \Illuminate\Http\Response
*
* @throws DisplayException * @throws DisplayException
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
@ -117,9 +106,6 @@ class MailController extends Controller
/** /**
* Submit a request to send a test mail message. * Submit a request to send a test mail message.
*
* @param Request $request
* @return \Illuminate\Http\Response
*/ */
public function test(Request $request): Response public function test(Request $request): Response
{ {

View File

@ -46,7 +46,7 @@ class StatisticsController extends Controller
public function index() public function index()
{ {
throw new NotFoundHttpException; throw new NotFoundHttpException();
$servers = $this->serverRepository->all(); $servers = $this->serverRepository->all();
$nodes = $this->nodeRepository->all(); $nodes = $this->nodeRepository->all();
$usersCount = $this->userRepository->count(); $usersCount = $this->userRepository->count();

View File

@ -52,13 +52,6 @@ class UserController extends Controller
/** /**
* UserController constructor. * UserController constructor.
*
* @param \Prologue\Alerts\AlertsMessageBag $alert
* @param \Pterodactyl\Services\Users\UserCreationService $creationService
* @param \Pterodactyl\Services\Users\UserDeletionService $deletionService
* @param \Illuminate\Contracts\Translation\Translator $translator
* @param \Pterodactyl\Services\Users\UserUpdateService $updateService
* @param \Pterodactyl\Contracts\Repository\UserRepositoryInterface $repository
*/ */
public function __construct( public function __construct(
AlertsMessageBag $alert, AlertsMessageBag $alert,
@ -79,7 +72,6 @@ class UserController extends Controller
/** /**
* Display user index page. * Display user index page.
* *
* @param \Illuminate\Http\Request $request
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function index(Request $request) public function index(Request $request)
@ -114,7 +106,6 @@ class UserController extends Controller
/** /**
* Display user view page. * Display user view page.
* *
* @param \Pterodactyl\Models\User $user
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function view(User $user) public function view(User $user)
@ -128,8 +119,6 @@ class UserController extends Controller
/** /**
* Delete a user from the system. * Delete a user from the system.
* *
* @param \Illuminate\Http\Request $request
* @param \Pterodactyl\Models\User $user
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Exception * @throws \Exception
@ -149,7 +138,6 @@ class UserController extends Controller
/** /**
* Create a user. * Create a user.
* *
* @param \Pterodactyl\Http\Requests\Admin\UserFormRequest $request
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Exception * @throws \Exception
@ -166,8 +154,6 @@ class UserController extends Controller
/** /**
* Update a user on the system. * Update a user on the system.
* *
* @param \Pterodactyl\Http\Requests\Admin\UserFormRequest $request
* @param \Pterodactyl\Models\User $user
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* *
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
@ -187,7 +173,6 @@ class UserController extends Controller
/** /**
* Get a JSON response of users on the system. * Get a JSON response of users on the system.
* *
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Support\Collection|\Pterodactyl\Models\Model * @return \Illuminate\Support\Collection|\Pterodactyl\Models\Model
*/ */
public function json(Request $request) public function json(Request $request)

View File

@ -45,9 +45,6 @@ abstract class ApplicationApiController extends Controller
/** /**
* Perform dependency injection of certain classes needed for core functionality * Perform dependency injection of certain classes needed for core functionality
* without littering the constructors of classes that extend this abstract. * without littering the constructors of classes that extend this abstract.
*
* @param \Pterodactyl\Extensions\Spatie\Fractalistic\Fractal $fractal
* @param \Illuminate\Http\Request $request
*/ */
public function loadDependencies(Fractal $fractal, Request $request) public function loadDependencies(Fractal $fractal, Request $request)
{ {
@ -58,7 +55,6 @@ abstract class ApplicationApiController extends Controller
/** /**
* Return an instance of an application transformer. * Return an instance of an application transformer.
* *
* @param string $abstract
* @return \Pterodactyl\Transformers\Api\Application\BaseTransformer * @return \Pterodactyl\Transformers\Api\Application\BaseTransformer
*/ */
public function getTransformer(string $abstract) public function getTransformer(string $abstract)
@ -74,8 +70,6 @@ abstract class ApplicationApiController extends Controller
/** /**
* Return a HTTP/204 response for the API. * Return a HTTP/204 response for the API.
*
* @return \Illuminate\Http\Response
*/ */
protected function returnNoContent(): Response protected function returnNoContent(): Response
{ {

View File

@ -42,11 +42,6 @@ class LocationController extends ApplicationApiController
/** /**
* LocationController constructor. * LocationController constructor.
*
* @param \Pterodactyl\Services\Locations\LocationCreationService $creationService
* @param \Pterodactyl\Services\Locations\LocationDeletionService $deletionService
* @param \Pterodactyl\Contracts\Repository\LocationRepositoryInterface $repository
* @param \Pterodactyl\Services\Locations\LocationUpdateService $updateService
*/ */
public function __construct( public function __construct(
LocationCreationService $creationService, LocationCreationService $creationService,
@ -64,9 +59,6 @@ class LocationController extends ApplicationApiController
/** /**
* Return all of the locations currently registered on the Panel. * Return all of the locations currently registered on the Panel.
*
* @param \Pterodactyl\Http\Requests\Api\Application\Locations\GetLocationsRequest $request
* @return array
*/ */
public function index(GetLocationsRequest $request): array public function index(GetLocationsRequest $request): array
{ {
@ -82,9 +74,6 @@ class LocationController extends ApplicationApiController
/** /**
* Return a single location. * Return a single location.
*
* @param \Pterodactyl\Http\Requests\Api\Application\Locations\GetLocationRequest $request
* @return array
*/ */
public function view(GetLocationRequest $request): array public function view(GetLocationRequest $request): array
{ {
@ -97,9 +86,6 @@ class LocationController extends ApplicationApiController
* Store a new location on the Panel and return a HTTP/201 response code with the * Store a new location on the Panel and return a HTTP/201 response code with the
* new location attached. * new location attached.
* *
* @param \Pterodactyl\Http\Requests\Api\Application\Locations\StoreLocationRequest $request
* @return \Illuminate\Http\JsonResponse
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/ */
public function store(StoreLocationRequest $request): JsonResponse public function store(StoreLocationRequest $request): JsonResponse
@ -119,9 +105,6 @@ class LocationController extends ApplicationApiController
/** /**
* Update a location on the Panel and return the updated record to the user. * Update a location on the Panel and return the updated record to the user.
* *
* @param \Pterodactyl\Http\Requests\Api\Application\Locations\UpdateLocationRequest $request
* @return array
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/ */
@ -137,9 +120,6 @@ class LocationController extends ApplicationApiController
/** /**
* Delete a location from the Panel. * Delete a location from the Panel.
* *
* @param \Pterodactyl\Http\Requests\Api\Application\Locations\DeleteLocationRequest $request
* @return \Illuminate\Http\Response
*
* @throws \Pterodactyl\Exceptions\Service\Location\HasActiveNodesException * @throws \Pterodactyl\Exceptions\Service\Location\HasActiveNodesException
*/ */
public function delete(DeleteLocationRequest $request): Response public function delete(DeleteLocationRequest $request): Response

View File

@ -19,8 +19,6 @@ class EggController extends ApplicationApiController
/** /**
* EggController constructor. * EggController constructor.
*
* @param \Pterodactyl\Contracts\Repository\EggRepositoryInterface $repository
*/ */
public function __construct(EggRepositoryInterface $repository) public function __construct(EggRepositoryInterface $repository)
{ {
@ -31,9 +29,6 @@ class EggController extends ApplicationApiController
/** /**
* Return all eggs that exist for a given nest. * Return all eggs that exist for a given nest.
*
* @param \Pterodactyl\Http\Requests\Api\Application\Nests\Eggs\GetEggsRequest $request
* @return array
*/ */
public function index(GetEggsRequest $request): array public function index(GetEggsRequest $request): array
{ {
@ -48,9 +43,6 @@ class EggController extends ApplicationApiController
/** /**
* Return a single egg that exists on the specified nest. * Return a single egg that exists on the specified nest.
*
* @param \Pterodactyl\Http\Requests\Api\Application\Nests\Eggs\GetEggRequest $request
* @return array
*/ */
public function view(GetEggRequest $request): array public function view(GetEggRequest $request): array
{ {

View File

@ -17,8 +17,6 @@ class NestController extends ApplicationApiController
/** /**
* NestController constructor. * NestController constructor.
*
* @param \Pterodactyl\Contracts\Repository\NestRepositoryInterface $repository
*/ */
public function __construct(NestRepositoryInterface $repository) public function __construct(NestRepositoryInterface $repository)
{ {
@ -29,9 +27,6 @@ class NestController extends ApplicationApiController
/** /**
* Return all Nests that exist on the Panel. * Return all Nests that exist on the Panel.
*
* @param \Pterodactyl\Http\Requests\Api\Application\Nests\GetNestsRequest $request
* @return array
*/ */
public function index(GetNestsRequest $request): array public function index(GetNestsRequest $request): array
{ {
@ -44,9 +39,6 @@ class NestController extends ApplicationApiController
/** /**
* Return information about a single Nest model. * Return information about a single Nest model.
*
* @param \Pterodactyl\Http\Requests\Api\Application\Nests\GetNestsRequest $request
* @return array
*/ */
public function view(GetNestsRequest $request): array public function view(GetNestsRequest $request): array
{ {

View File

@ -27,9 +27,6 @@ class AllocationController extends ApplicationApiController
/** /**
* AllocationController constructor. * AllocationController constructor.
*
* @param \Pterodactyl\Services\Allocations\AssignmentService $assignmentService
* @param \Pterodactyl\Services\Allocations\AllocationDeletionService $deletionService
*/ */
public function __construct( public function __construct(
AssignmentService $assignmentService, AssignmentService $assignmentService,
@ -43,10 +40,6 @@ class AllocationController extends ApplicationApiController
/** /**
* Return all of the allocations that exist for a given node. * Return all of the allocations that exist for a given node.
*
* @param \Pterodactyl\Http\Requests\Api\Application\Allocations\GetAllocationsRequest $request
* @param \Pterodactyl\Models\Node $node
* @return array
*/ */
public function index(GetAllocationsRequest $request, Node $node): array public function index(GetAllocationsRequest $request, Node $node): array
{ {
@ -60,10 +53,6 @@ class AllocationController extends ApplicationApiController
/** /**
* Store new allocations for a given node. * Store new allocations for a given node.
* *
* @param \Pterodactyl\Http\Requests\Api\Application\Allocations\StoreAllocationRequest $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Http\JsonResponse
*
* @throws \Pterodactyl\Exceptions\Service\Allocation\CidrOutOfRangeException * @throws \Pterodactyl\Exceptions\Service\Allocation\CidrOutOfRangeException
* @throws \Pterodactyl\Exceptions\Service\Allocation\InvalidPortMappingException * @throws \Pterodactyl\Exceptions\Service\Allocation\InvalidPortMappingException
* @throws \Pterodactyl\Exceptions\Service\Allocation\PortOutOfRangeException * @throws \Pterodactyl\Exceptions\Service\Allocation\PortOutOfRangeException
@ -79,11 +68,6 @@ class AllocationController extends ApplicationApiController
/** /**
* Delete a specific allocation from the Panel. * Delete a specific allocation from the Panel.
* *
* @param \Pterodactyl\Http\Requests\Api\Application\Allocations\DeleteAllocationRequest $request
* @param \Pterodactyl\Models\Node $node
* @param \Pterodactyl\Models\Allocation $allocation
* @return \Illuminate\Http\JsonResponse
*
* @throws \Pterodactyl\Exceptions\Service\Allocation\ServerUsingAllocationException * @throws \Pterodactyl\Exceptions\Service\Allocation\ServerUsingAllocationException
*/ */
public function delete(DeleteAllocationRequest $request, Node $node, Allocation $allocation): JsonResponse public function delete(DeleteAllocationRequest $request, Node $node, Allocation $allocation): JsonResponse

View File

@ -14,8 +14,6 @@ class NodeConfigurationController extends ApplicationApiController
* to remote machines so long as an API key is provided to the machine to make the request * to remote machines so long as an API key is provided to the machine to make the request
* with, and the node is known. * with, and the node is known.
* *
* @param \Pterodactyl\Http\Requests\Api\Application\Nodes\GetNodeRequest $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function __invoke(GetNodeRequest $request, Node $node) public function __invoke(GetNodeRequest $request, Node $node)

Some files were not shown because too many files have changed in this diff Show More