Skip to content

Commit

Permalink
chore: run php-cs-fixer
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Penner <[email protected]>
  • Loading branch information
matthewpi committed Oct 22, 2024
1 parent 99d5aaf commit 8189dd8
Show file tree
Hide file tree
Showing 216 changed files with 500 additions and 506 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/Location/DeleteLocationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DeleteLocationCommand extends Command
*/
public function __construct(
private LocationDeletionService $deletionService,
private LocationRepositoryInterface $repository
private LocationRepositoryInterface $repository,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Node/NodeConfigurationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function handle(): int
{
$column = ctype_digit((string) $this->argument('node')) ? 'id' : 'uuid';

/** @var \Pterodactyl\Models\Node $node */
/** @var Node $node */
$node = Node::query()->where($column, $this->argument('node'))->firstOr(function () {
$this->error('The selected node does not exist.');

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Server/BulkPowerActionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(private DaemonPowerRepository $powerRepository, priv
/**
* Handle the bulk power request.
*
* @throws \Illuminate\Validation\ValidationException
* @throws ValidationException
*/
public function handle()
{
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/UpgradeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function handle()

/** @var \Illuminate\Foundation\Application $app */
$app = require __DIR__ . '/../../../bootstrap/app.php';
/** @var \Pterodactyl\Console\Kernel $kernel */
/** @var Kernel $kernel */
$kernel = $app->make(Kernel::class);
$kernel->bootstrap();
$this->setLaravel($app);
Expand Down
2 changes: 1 addition & 1 deletion app/Contracts/Extensions/HashidsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ interface HashidsInterface extends VendorHashidsInterface
*
* @throws \InvalidArgumentException
*/
public function decodeFirst(string $encoded, string $default = null): mixed;
public function decodeFirst(string $encoded, ?string $default = null): mixed;
}
4 changes: 2 additions & 2 deletions app/Contracts/Repository/NestRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ interface NestRepositoryInterface extends RepositoryInterface
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function getWithEggs(int $id = null): Collection|Nest;
public function getWithEggs(?int $id = null): Collection|Nest;

/**
* Return a nest or all nests and the count of eggs and servers for that nest.
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function getWithCounts(int $id = null): Collection|Nest;
public function getWithCounts(?int $id = null): Collection|Nest;

/**
* Return a nest along with its associated eggs and the servers relation on those eggs.
Expand Down
4 changes: 2 additions & 2 deletions app/Contracts/Repository/ServerRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public function loadEggRelations(Server $server, bool $refresh = false): Server;
/**
* Return a collection of servers with their associated data for rebuild operations.
*/
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.
*/
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.
Expand Down
2 changes: 1 addition & 1 deletion app/Contracts/Repository/SettingsRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface SettingsRepositoryInterface extends RepositoryInterface
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function set(string $key, string $value = null);
public function set(string $key, ?string $value = null);

/**
* Retrieve a persistent setting from the database.
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/DisplayException.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function report()

try {
$logger = Container::getInstance()->make(LoggerInterface::class);
} catch (Exception) {
} catch (\Exception) {
throw $this->getPrevious();
}

Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Http/HttpForbiddenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class HttpForbiddenException extends HttpException
/**
* HttpForbiddenException constructor.
*/
public function __construct(string $message = null, \Throwable $previous = null)
public function __construct(?string $message = null, ?\Throwable $previous = null)
{
parent::__construct(Response::HTTP_FORBIDDEN, $message, $previous);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ServerStateConflictException extends ConflictHttpException
* Exception thrown when the server is in an unsupported state for API access or
* certain operations within the codebase.
*/
public function __construct(Server $server, \Throwable $previous = null)
public function __construct(Server $server, ?\Throwable $previous = null)
{
$message = 'This server is currently in an unsupported state, please try again later.';
if ($server->isSuspended()) {
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Http/TwoFactorAuthRequiredException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TwoFactorAuthRequiredException extends HttpException implements HttpExcept
/**
* TwoFactorAuthRequiredException constructor.
*/
public function __construct(\Throwable $previous = null)
public function __construct(?\Throwable $previous = null)
{
parent::__construct(Response::HTTP_BAD_REQUEST, 'Two-factor authentication is required on this account in order to access this endpoint.', $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Service/ServiceLimitExceededException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ServiceLimitExceededException extends DisplayException
* Exception thrown when something goes over a defined limit, such as allocated
* ports, tasks, databases, etc.
*/
public function __construct(string $message, \Throwable $previous = null)
public function __construct(string $message, ?\Throwable $previous = null)
{
parent::__construct($message, $previous, self::LEVEL_WARNING);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Extensions/Backups/BackupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(protected Application $app)
/**
* Returns a backup adapter instance.
*/
public function adapter(string $name = null): FilesystemAdapter
public function adapter(?string $name = null): FilesystemAdapter
{
return $this->get($name ?: $this->getDefaultAdapter());
}
Expand Down
2 changes: 1 addition & 1 deletion app/Extensions/DynamicDatabaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DynamicDatabaseConnection
public function __construct(
protected ConfigRepository $config,
protected Encrypter $encrypter,
protected DatabaseHostRepositoryInterface $repository
protected DatabaseHostRepositoryInterface $repository,
) {
}

Expand Down
5 changes: 1 addition & 4 deletions app/Extensions/Hashids.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

class Hashids extends VendorHashids implements HashidsInterface
{
/**
* {@inheritdoc}
*/
public function decodeFirst(string $encoded, string $default = null): mixed
public function decodeFirst(string $encoded, ?string $default = null): mixed
{
$result = $this->decode($encoded);
if (!is_array($result)) {
Expand Down
2 changes: 1 addition & 1 deletion app/Extensions/Laravel/Sanctum/NewAccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Laravel\Sanctum\NewAccessToken as SanctumAccessToken;

/**
* @property \Pterodactyl\Models\ApiKey $accessToken
* @property ApiKey $accessToken
*/
class NewAccessToken extends SanctumAccessToken
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/DatabaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
private HostDeletionService $deletionService,
private HostUpdateService $updateService,
private LocationRepositoryInterface $locationRepository,
private ViewFactory $view
private ViewFactory $view,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Admin/LocationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(
protected LocationDeletionService $deletionService,
protected LocationRepositoryInterface $repository,
protected LocationUpdateService $updateService,
protected ViewFactory $view
protected ViewFactory $view,
) {
}

Expand Down Expand Up @@ -86,7 +86,7 @@ public function update(LocationFormRequest $request, Location $location): Redire
* Delete a location from the system.
*
* @throws \Exception
* @throws \Pterodactyl\Exceptions\DisplayException
* @throws DisplayException
*/
public function delete(Location $location): RedirectResponse
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/MountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
protected NestRepositoryInterface $nestRepository,
protected LocationRepositoryInterface $locationRepository,
protected MountRepository $repository,
protected ViewFactory $view
protected ViewFactory $view,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Admin/Nests/EggController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
protected EggRepositoryInterface $repository,
protected EggUpdateService $updateService,
protected NestRepositoryInterface $nestRepository,
protected ViewFactory $view
protected ViewFactory $view,
) {
}

Expand Down Expand Up @@ -111,7 +111,7 @@ public function destroy(Egg $egg): RedirectResponse
/**
* Normalizes a string of docker image data into the expected egg format.
*/
protected function normalizeDockerImages(string $input = null): array
protected function normalizeDockerImages(?string $input = null): array
{
$data = array_map(fn ($value) => trim($value), explode("\n", $input ?? ''));

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/Nests/EggScriptController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(
protected AlertsMessageBag $alert,
protected EggRepositoryInterface $repository,
protected InstallScriptService $installScriptService,
protected ViewFactory $view
protected ViewFactory $view,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/Nests/EggShareController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(
protected AlertsMessageBag $alert,
protected EggExporterService $exporterService,
protected EggImporterService $importerService,
protected EggUpdateImporterService $updateImporterService
protected EggUpdateImporterService $updateImporterService,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/Nests/EggVariableController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(
protected VariableUpdateService $updateService,
protected EggRepositoryInterface $repository,
protected EggVariableRepositoryInterface $variableRepository,
protected ViewFactory $view
protected ViewFactory $view,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/Nests/NestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
protected NestDeletionService $nestDeletionService,
protected NestRepositoryInterface $repository,
protected NestUpdateService $nestUpdateService,
protected ViewFactory $view
protected ViewFactory $view,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Admin/NodeAutoDeployController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NodeAutoDeployController extends Controller
public function __construct(
private ApiKeyRepository $repository,
private Encrypter $encrypter,
private KeyCreationService $keyCreationService
private KeyCreationService $keyCreationService,
) {
}

Expand All @@ -31,7 +31,7 @@ public function __construct(
*/
public function __invoke(Request $request, Node $node): JsonResponse
{
/** @var \Pterodactyl\Models\ApiKey|null $key */
/** @var ApiKey|null $key */
$key = $this->repository->getApplicationKeys($request->user())
->filter(function (ApiKey $key) {
foreach ($key->getAttributes() as $permission => $value) {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/Nodes/NodeViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(
private NodeRepository $repository,
private ServerRepository $serverRepository,
private SoftwareVersionService $versionService,
private ViewFactory $view
private ViewFactory $view,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/NodesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(
protected ServerRepositoryInterface $serverRepository,
protected NodeUpdateService $updateService,
protected SoftwareVersionService $versionService,
protected ViewFactory $view
protected ViewFactory $view,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
private NestRepository $nestRepository,
private NodeRepository $nodeRepository,
private ServerCreationService $creationService,
private ViewFactory $view
private ViewFactory $view,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(
private ConnectionInterface $connection,
private DaemonTransferRepository $daemonTransferRepository,
private NodeJWTService $nodeJWTService,
private NodeRepository $nodeRepository
private NodeRepository $nodeRepository,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Admin/Servers/ServerViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(
private NodeRepository $nodeRepository,
private ServerRepository $repository,
private EnvironmentService $environmentService,
private ViewFactory $view
private ViewFactory $view,
) {
}

Expand Down Expand Up @@ -118,7 +118,7 @@ public function mounts(Request $request, Server $server): View
* Returns the base server management page, or an exception if the server
* is in a state that cannot be recovered from.
*
* @throws \Pterodactyl\Exceptions\DisplayException
* @throws DisplayException
*/
public function manage(Request $request, Server $server): View
{
Expand Down
Loading

0 comments on commit 8189dd8

Please sign in to comment.