From ae296bda867f5f2644e8f881498d26e13db70ab3 Mon Sep 17 00:00:00 2001 From: robert dennis <31261583+robertdrakedennis@users.noreply.github.com> Date: Sun, 11 Oct 2026 19:54:55 -0400 Subject: [PATCH] drop json aliases --- app/Actions/Activity/IngestActivityLogs.php | 6 +- app/Actions/Allocations/CreateAllocations.php | 4 +- app/Actions/Api/CreateAccountApiKey.php | 2 +- app/Actions/Api/CreateApiKey.php | 8 +- app/Actions/Api/UpdateApiKey.php | 6 +- app/Actions/Backups/CompleteBackup.php | 4 +- app/Actions/Backups/InitiateBackup.php | 2 +- app/Actions/Databases/CreateDatabase.php | 4 +- app/Actions/Databases/CreateDatabaseHost.php | 4 +- .../Databases/DeployServerDatabase.php | 4 +- app/Actions/Databases/UpdateDatabaseHost.php | 2 +- app/Actions/Eggs/CreateEgg.php | 4 +- .../Eggs/Scripts/UpdateInstallScript.php | 4 +- app/Actions/Eggs/UpdateEgg.php | 2 +- .../Eggs/Variables/CreateEggVariable.php | 4 +- .../Eggs/Variables/ReorderEggVariables.php | 4 +- .../Eggs/Variables/UpdateEggVariable.php | 2 +- app/Actions/Files/ChangeFilePermissions.php | 2 +- app/Actions/Files/CompressFiles.php | 2 +- app/Actions/Files/DeleteFiles.php | 2 +- app/Actions/Files/PullFile.php | 2 +- app/Actions/Files/RenameFiles.php | 2 +- app/Actions/Locations/CreateLocation.php | 4 +- app/Actions/Locations/UpdateLocation.php | 2 +- app/Actions/Mounts/AttachEggsToMount.php | 4 +- app/Actions/Mounts/AttachNodesToMount.php | 4 +- app/Actions/Mounts/CreateMount.php | 4 +- app/Actions/Mounts/UpdateMount.php | 2 +- app/Actions/Nodes/CreateNode.php | 4 +- app/Actions/Nodes/UpdateNode.php | 2 +- app/Actions/Schedules/CreateSchedule.php | 4 +- app/Actions/Schedules/CreateScheduleTask.php | 4 +- app/Actions/Schedules/UpdateSchedule.php | 2 +- app/Actions/Schedules/UpdateScheduleTask.php | 2 +- app/Actions/Servers/CreateServer.php | 6 +- app/Actions/Servers/UpdateServerBuild.php | 4 +- app/Actions/Servers/UpdateServerDetails.php | 4 +- app/Actions/Servers/UpdateServerStartup.php | 6 +- app/Actions/Subusers/CreateSubuser.php | 2 +- app/Actions/Tags/CreateTag.php | 4 +- app/Actions/Tags/SyncTags.php | 8 +- app/Actions/Tags/UpdateTag.php | 2 +- app/Actions/Users/CreateSshKey.php | 2 +- app/Actions/Users/CreateUser.php | 4 +- app/Actions/Users/UpdateUser.php | 2 +- .../Activity/IngestsActivityLogs.php | 2 +- .../Allocations/CreatesAllocations.php | 2 +- app/Contracts/Api/CreatesApiKeys.php | 4 +- app/Contracts/Api/UpdatesApiKeys.php | 4 +- app/Contracts/Backups/CompletesBackups.php | 2 +- .../Databases/CreatesDatabaseHosts.php | 2 +- app/Contracts/Databases/CreatesDatabases.php | 2 +- .../Databases/DeploysServerDatabases.php | 2 +- .../Databases/UpdatesDatabaseHosts.php | 2 +- app/Contracts/Eggs/CreatesEggVariables.php | 2 +- app/Contracts/Eggs/CreatesEggs.php | 2 +- app/Contracts/Eggs/ReordersEggVariables.php | 2 +- .../Eggs/UpdatesEggInstallScripts.php | 2 +- app/Contracts/Eggs/UpdatesEggVariables.php | 2 +- app/Contracts/Eggs/UpdatesEggs.php | 2 +- .../Files/ChangesFilePermissions.php | 2 +- app/Contracts/Files/CompressesFiles.php | 2 +- app/Contracts/Files/DeletesFiles.php | 2 +- app/Contracts/Files/PullsFiles.php | 2 +- app/Contracts/Files/RenamesFiles.php | 2 +- app/Contracts/Locations/CreatesLocations.php | 2 +- app/Contracts/Locations/UpdatesLocations.php | 2 +- app/Contracts/Mounts/AttachesEggsToMounts.php | 2 +- .../Mounts/AttachesNodesToMounts.php | 2 +- app/Contracts/Mounts/CreatesMounts.php | 2 +- app/Contracts/Mounts/UpdatesMounts.php | 2 +- app/Contracts/Nodes/CreatesNodes.php | 2 +- app/Contracts/Nodes/UpdatesNodes.php | 2 +- .../Schedules/CreatesScheduleTasks.php | 2 +- app/Contracts/Schedules/CreatesSchedules.php | 2 +- .../Schedules/UpdatesScheduleTasks.php | 2 +- app/Contracts/Schedules/UpdatesSchedules.php | 2 +- app/Contracts/Servers/CreatesServers.php | 2 +- app/Contracts/Servers/UpdatesServerBuild.php | 2 +- .../Servers/UpdatesServerDetails.php | 2 +- .../Servers/UpdatesServerStartup.php | 2 +- app/Contracts/Tags/CreatesTags.php | 2 +- app/Contracts/Tags/SyncsTags.php | 6 +- app/Contracts/Tags/UpdatesTags.php | 2 +- app/Contracts/Users/CreatesUsers.php | 2 +- app/Contracts/Users/UpdatesUsers.php | 2 +- app/Data/AllocationRange.php | 5 -- app/Data/EggCatalogEntry.php | 1 - app/Data/LoginResult.php | 2 +- app/Exceptions/ApiErrorResponse.php | 2 +- .../InvalidPortMappingException.php | 2 +- app/Extensions/Backups/BackupManager.php | 2 - app/Extensions/Filesystem/S3Filesystem.php | 2 +- .../Serializers/PterodactylSerializer.php | 17 ++-- .../Attributes/ResponseFromResource.php | 8 +- .../Attributes/ResponseFromTransformer.php | 8 +- .../UsePterodactylResponseAttributes.php | 2 +- .../Spatie/Fractalistic/Fractal.php | 2 +- .../Api/Admin/ActivityController.php | 2 +- .../Api/Admin/ApiKeys/ApiKeyController.php | 6 +- .../DatabaseHosts/DatabaseHostController.php | 8 +- .../Api/Admin/Eggs/EggController.php | 6 +- .../Api/Admin/Eggs/EggScriptController.php | 4 +- .../Api/Admin/Eggs/EggVariableController.php | 4 +- .../Admin/Eggs/ReorderVariablesController.php | 2 +- .../Admin/Eggs/UpdateImportEggController.php | 2 +- .../Admin/Extensions/ExtensionController.php | 4 +- .../Locations/EligibleNodesController.php | 2 +- .../Admin/Locations/LocationController.php | 6 +- .../Api/Admin/Mounts/AttachEggsController.php | 2 +- .../Admin/Mounts/AttachNodesController.php | 2 +- .../Api/Admin/Mounts/MountController.php | 6 +- .../Api/Admin/Nodes/AllocationController.php | 4 +- .../Nodes/AvailableAllocationsController.php | 2 +- .../Api/Admin/Nodes/NodeController.php | 6 +- .../Api/Admin/Servers/BuildController.php | 2 +- .../Api/Admin/Servers/DatabaseController.php | 4 +- .../Api/Admin/Servers/DetailsController.php | 2 +- .../Api/Admin/Servers/ExternalController.php | 2 +- .../RotateDatabasePasswordController.php | 2 +- .../Admin/Servers/ServerBackupController.php | 2 +- .../Api/Admin/Servers/ServerController.php | 4 +- .../Api/Admin/Servers/StartupController.php | 2 +- .../Admin/Servers/ToggleBackupController.php | 2 +- .../Servers/TransferProgressController.php | 2 +- .../Api/Admin/Tags/TagController.php | 12 +-- .../Api/Admin/Users/ExternalController.php | 2 +- .../Api/Admin/Users/UserController.php | 6 +- .../Api/Application/Eggs/EggController.php | 4 +- .../Locations/LocationController.php | 6 +- .../Nodes/AllocationController.php | 2 +- .../Api/Application/Nodes/NodeController.php | 6 +- .../Nodes/NodeDeploymentController.php | 2 +- .../Servers/DatabaseController.php | 4 +- .../Servers/ExternalServerController.php | 2 +- .../Application/Servers/ServerController.php | 4 +- .../Servers/ServerDetailsController.php | 4 +- .../Application/Servers/StartupController.php | 2 +- .../Api/Application/Tags/TagController.php | 4 +- .../Users/ExternalUserController.php | 2 +- .../Api/Application/Users/UserController.php | 6 +- .../Api/Client/AccountController.php | 2 +- .../Api/Client/ActivityLogController.php | 2 +- .../Api/Client/ApiKeyController.php | 4 +- .../Api/Client/ClientController.php | 2 +- .../Api/Client/SSHKeyController.php | 4 +- .../Client/Servers/ActivityLogController.php | 2 +- .../Api/Client/Servers/BackupController.php | 8 +- .../Api/Client/Servers/DatabaseController.php | 6 +- .../Api/Client/Servers/FileController.php | 4 +- .../Servers/NetworkAllocationController.php | 8 +- .../Servers/ResourceUtilizationController.php | 2 +- .../Api/Client/Servers/ScheduleController.php | 8 +- .../Client/Servers/ScheduleTaskController.php | 4 +- .../Api/Client/Servers/ServerController.php | 2 +- .../Api/Client/Servers/StartupController.php | 4 +- .../Api/Client/Servers/SubuserController.php | 8 +- .../Controllers/Base/LocaleController.php | 6 +- .../Api/Admin/ApiKeys/StoreApiKeyRequest.php | 4 +- .../Databases/StoreDatabaseRequest.php | 2 +- .../Api/Admin/Servers/StoreServerRequest.php | 2 +- .../UpdateServerBuildConfigurationRequest.php | 2 +- .../Api/Admin/Users/StoreUserRequest.php | 2 +- app/Http/Requests/Api/ApiRequest.php | 8 +- .../Allocations/StoreAllocationRequest.php | 2 +- .../Databases/StoreServerDatabaseRequest.php | 2 +- .../Servers/StoreServerRequest.php | 2 +- .../UpdateServerBuildConfigurationRequest.php | 2 +- .../Servers/UpdateServerDetailsRequest.php | 2 +- .../Servers/UpdateServerStartupRequest.php | 2 +- .../Application/Users/StoreUserRequest.php | 2 +- .../Concerns/ValidatesExtensionFields.php | 2 +- .../Api/Admin/ServerDatabaseResource.php | 2 +- app/Http/Resources/Api/ApiResource.php | 6 +- .../Api/Application/EggVariableResource.php | 8 +- .../Application/ServerVariableResource.php | 8 +- app/Http/Resources/Api/CallbackResource.php | 6 +- .../Resources/Api/Client/DatabaseResource.php | 2 +- .../Api/Client/UserSSHKeyResource.php | 2 +- .../Wings/ServerConfigurationCollection.php | 4 +- app/Listeners/AuthenticationListener.php | 2 - app/Models/ActivityLog.php | 10 +-- app/Models/Objects/DeploymentObject.php | 6 +- app/Models/User.php | 2 +- app/Policies/ServerPolicy.php | 2 +- app/Rules/Fqdn.php | 4 +- .../Activity/ActivityLogBatchService.php | 2 +- app/Services/Activity/ActivityLogService.php | 9 +-- app/Services/Daemon/DaemonConnection.php | 4 +- app/Services/Daemon/FilesClient.php | 10 +-- app/Services/Daemon/NodeClient.php | 2 +- .../Deployment/AllocationSelectionService.php | 4 +- app/Services/Eggs/EggConfigurationService.php | 71 +++++++---------- app/Services/Eggs/EggImportData.php | 13 +--- app/Services/FilesystemChanges.php | 2 +- .../Helpers/SoftwareVersionService.php | 1 - app/Services/Servers/EnvironmentService.php | 18 ++--- .../ServerConfigurationStructureService.php | 8 +- .../Servers/VariableValidatorService.php | 2 +- .../Telemetry/TelemetryCollectionService.php | 8 +- app/Support/JsonValueGuard.php | 26 +++---- app/Support/JsonValueTree.php | 77 ------------------- .../Api/Admin/AllocationTransformer.php | 2 +- .../Api/Admin/ApiKeyTransformer.php | 2 +- .../Api/Admin/BackupTransformer.php | 2 +- .../Api/Admin/DatabaseHostTransformer.php | 8 +- app/Transformers/Api/Admin/EggTransformer.php | 11 +-- .../Api/Admin/EggVariableTransformer.php | 2 +- .../Api/Admin/LocationTransformer.php | 8 +- .../Api/Admin/MountTransformer.php | 8 +- .../Api/Admin/NodeTransformer.php | 9 +-- .../Api/Admin/ServerDatabaseTransformer.php | 2 +- .../Api/Admin/ServerTransferTransformer.php | 2 +- .../Api/Admin/ServerTransformer.php | 8 +- .../Api/Admin/ServerVariableTransformer.php | 8 +- .../Api/Admin/SubuserTransformer.php | 2 +- app/Transformers/Api/Admin/TagTransformer.php | 2 +- .../Api/Admin/UserTransformer.php | 8 +- .../Api/Application/AllocationTransformer.php | 2 +- .../Application/DatabaseHostTransformer.php | 2 +- .../Api/Application/EggTransformer.php | 8 +- .../Application/EggVariableTransformer.php | 8 +- .../Api/Application/LocationTransformer.php | 8 +- .../Api/Application/NodeTransformer.php | 9 +-- .../Application/ServerDatabaseTransformer.php | 2 +- .../Application/ServerTransferTransformer.php | 2 +- .../Api/Application/ServerTransformer.php | 8 +- .../Application/ServerVariableTransformer.php | 8 +- .../Api/Application/SubuserTransformer.php | 2 +- .../Api/Application/TagTransformer.php | 2 +- .../Api/Application/UserTransformer.php | 8 +- .../Api/Client/AccountTransformer.php | 2 +- .../Api/Client/AllocationTransformer.php | 2 +- .../Api/Client/ApiKeyTransformer.php | 2 +- .../Api/Client/BackupTransformer.php | 2 +- .../Api/Client/DatabaseTransformer.php | 2 +- .../Api/Client/EggTransformer.php | 2 +- .../Api/Client/EggVariableTransformer.php | 2 +- .../Api/Client/FileObjectTransformer.php | 2 +- .../Api/Client/ScheduleTransformer.php | 2 +- .../Api/Client/ServerTransformer.php | 2 +- .../Api/Client/StatsTransformer.php | 2 +- .../Api/Client/SubuserTransformer.php | 2 +- .../Api/Client/TaskTransformer.php | 2 +- .../Api/Client/UserSSHKeyTransformer.php | 2 +- .../Api/Client/UserTransformer.php | 2 +- .../Concerns/FormatsActivityLogs.php | 24 +++--- phpstan.neon | 47 +++-------- .../Integration/Api/Parity/ResourceParity.php | 2 +- tests/Support/Fakes/FakeDaemonHttpClient.php | 2 +- .../Http/Resources/Api/ApiResourceTest.php | 10 +-- tests/Unit/JsonValueTreeTest.php | 25 ------ .../Helpers/SoftwareVersionServiceTest.php | 2 +- tests/Unit/WingsJsonResponseTest.php | 2 +- 254 files changed, 462 insertions(+), 729 deletions(-) delete mode 100644 app/Support/JsonValueTree.php delete mode 100644 tests/Unit/JsonValueTreeTest.php diff --git a/app/Actions/Activity/IngestActivityLogs.php b/app/Actions/Activity/IngestActivityLogs.php index 94b15346d..848c11c66 100644 --- a/app/Actions/Activity/IngestActivityLogs.php +++ b/app/Actions/Activity/IngestActivityLogs.php @@ -21,7 +21,7 @@ use Pterodactyl\Models\User; use Pterodactyl\Support\JsonValueGuard; /** - * @phpstan-type ActivityEvent array{user: string|null, server: string, event: string, metadata: array, ip: string|null, timestamp: string} + * @phpstan-type ActivityEvent array{user: string|null, server: string, event: string, metadata: array, ip: string|null, timestamp: string} */ final class IngestActivityLogs implements IngestsActivityLogs { @@ -50,7 +50,7 @@ final class IngestActivityLogs implements IngestsActivityLogs * Validates reported activity and returns the events it lists. Metadata given as null * is empty. * - * @param ActionInput $input + * @param array $input * @return list * * @throws ValidationException @@ -82,7 +82,7 @@ final class IngestActivityLogs implements IngestsActivityLogs } /** - * @param ActionInput $input + * @param array $input * * @throws ValidationException */ diff --git a/app/Actions/Allocations/CreateAllocations.php b/app/Actions/Allocations/CreateAllocations.php index 31921e279..73d72839b 100644 --- a/app/Actions/Allocations/CreateAllocations.php +++ b/app/Actions/Allocations/CreateAllocations.php @@ -71,7 +71,7 @@ final readonly class CreateAllocations implements CreatesAllocations * Validates allocation input and returns the address, ports and alias it describes. Each * port comes back as written, for create() to read as a single port or a range. * - * @param ActionInput $input + * @param array $input * @return array{ip: string, ports: list, ip_alias: string|null} */ public static function attributes(array $input): array @@ -91,7 +91,7 @@ final readonly class CreateAllocations implements CreatesAllocations } /** - * @param ActionInput $input + * @param array $input * * @throws DisplayException * @throws CidrOutOfRangeException diff --git a/app/Actions/Api/CreateAccountApiKey.php b/app/Actions/Api/CreateAccountApiKey.php index 63161c5f8..68f510d67 100644 --- a/app/Actions/Api/CreateAccountApiKey.php +++ b/app/Actions/Api/CreateAccountApiKey.php @@ -38,7 +38,7 @@ final readonly class CreateAccountApiKey implements CreatesAccountApiKeys * Validates account API key input and returns the description and the allowed IPs, or * null when none were given. * - * @param ActionInput $input + * @param array $input * @return array{description: string, allowed_ips: list|null} */ public static function attributes(array $input): array diff --git a/app/Actions/Api/CreateApiKey.php b/app/Actions/Api/CreateApiKey.php index a1da11832..46c605071 100644 --- a/app/Actions/Api/CreateApiKey.php +++ b/app/Actions/Api/CreateApiKey.php @@ -53,7 +53,7 @@ final readonly class CreateApiKey implements CreatesApiKeys * Validates API key input and returns the model attributes it describes. A key given * no allowed IPs, or null, can be used from any address. * - * @param ActionInput $input + * @param array $input * @return array{memo: string, user_id: int, allowed_ips?: list} */ public static function attributes(array $input): array @@ -80,7 +80,7 @@ final readonly class CreateApiKey implements CreatesApiKeys * the permissions given are returned, so the rest keep their stored values, or the * column default of AdminAcl::NONE on a new key. * - * @param ActionInput $permissions + * @param array $permissions * @return array */ public static function permissions(array $permissions): array @@ -98,8 +98,8 @@ final readonly class CreateApiKey implements CreatesApiKeys } /** - * @param ActionInput $input - * @param ActionInput $permissions + * @param array $input + * @param array $permissions */ public function create(int $keyType, array $input, array $permissions = []): ApiKey { diff --git a/app/Actions/Api/UpdateApiKey.php b/app/Actions/Api/UpdateApiKey.php index 77d5d0756..ddbf79749 100644 --- a/app/Actions/Api/UpdateApiKey.php +++ b/app/Actions/Api/UpdateApiKey.php @@ -13,8 +13,8 @@ final readonly class UpdateApiKey implements UpdatesApiKeys /** * Update an API key's attributes without regenerating its token. * - * @param ActionInput $input - * @param ActionInput $permissions + * @param array $input + * @param array $permissions */ public function update(ApiKey $key, array $input, array $permissions = []): ApiKey { @@ -34,7 +34,7 @@ final readonly class UpdateApiKey implements UpdatesApiKeys * Validates update input and returns the attributes it changes: the memo, when it is * given. A key's owner and allowed IPs are set when it is created. * - * @param ActionInput $input + * @param array $input * @return array{memo?: string} */ private function attributes(array $input): array diff --git a/app/Actions/Backups/CompleteBackup.php b/app/Actions/Backups/CompleteBackup.php index a00ede4e4..ffdb262bb 100644 --- a/app/Actions/Backups/CompleteBackup.php +++ b/app/Actions/Backups/CompleteBackup.php @@ -49,7 +49,7 @@ final readonly class CompleteBackup implements CompletesBackups * Validates a reported outcome and returns the outcome it describes. A size left out is * 0, and parts left out or null are null, so the upload's parts are listed from S3. * - * @param ActionInput $input + * @param array $input * @return CompletionAttributes */ public static function attributes(array $input): array @@ -74,7 +74,7 @@ final readonly class CompleteBackup implements CompletesBackups * Records the outcome Wings reported for a backup and, for S3 storage, closes the * multipart upload it belongs to. * - * @param ActionInput $input + * @param array $input * * @throws DisplayException * @throws ValidationException diff --git a/app/Actions/Backups/InitiateBackup.php b/app/Actions/Backups/InitiateBackup.php index e073511cf..76bdb10b5 100644 --- a/app/Actions/Backups/InitiateBackup.php +++ b/app/Actions/Backups/InitiateBackup.php @@ -54,7 +54,7 @@ final class InitiateBackup implements InitiatesBackups * Validates backup input and returns the backup it describes. A name left out or blank * is null, and empty entries are dropped from the ignored files. * - * @param ActionInput $input + * @param array $input * @return array{name: string|null, is_locked: bool, ignored_files: list} */ public static function attributes(array $input): array diff --git a/app/Actions/Databases/CreateDatabase.php b/app/Actions/Databases/CreateDatabase.php index 027d93e91..2114f3d52 100644 --- a/app/Actions/Databases/CreateDatabase.php +++ b/app/Actions/Databases/CreateDatabase.php @@ -62,7 +62,7 @@ final class CreateDatabase implements CreatesDatabases * limit is left out when it is not given, so the database takes the column default; a * blank one is stored as null. Null and 0 both leave the user's connections unlimited. * - * @param ActionInput $input + * @param array $input * @return DatabaseCreationData */ public static function attributes(array $input): array @@ -90,7 +90,7 @@ final class CreateDatabase implements CreatesDatabases } /** - * @param ActionInput $input + * @param array $input * * @throws Throwable * @throws TooManyDatabasesException diff --git a/app/Actions/Databases/CreateDatabaseHost.php b/app/Actions/Databases/CreateDatabaseHost.php index 446b92361..09eeabe41 100644 --- a/app/Actions/Databases/CreateDatabaseHost.php +++ b/app/Actions/Databases/CreateDatabaseHost.php @@ -41,7 +41,7 @@ final readonly class CreateDatabaseHost implements CreatesDatabaseHosts * password comes back in plain text, for the action to encrypt, and is left out when it * is blank so an updated host keeps its stored one. A host given no node is global. * - * @param ActionInput $input + * @param array $input * @return array{name: string, host: string, port: int, username: string, node_id: int|null, password?: string} */ public static function attributes(array $input): array @@ -66,7 +66,7 @@ final readonly class CreateDatabaseHost implements CreatesDatabaseHosts /** * Create a new database host on the Panel once it accepts the given credentials. * - * @param ActionInput $input + * @param array $input * * @throws Throwable */ diff --git a/app/Actions/Databases/DeployServerDatabase.php b/app/Actions/Databases/DeployServerDatabase.php index 833c6e239..5004b0661 100644 --- a/app/Actions/Databases/DeployServerDatabase.php +++ b/app/Actions/Databases/DeployServerDatabase.php @@ -44,7 +44,7 @@ final readonly class DeployServerDatabase implements DeploysServerDatabases * Validates deployment input and returns the database it describes, its name not yet * prefixed. A database given no connection limit gets none. * - * @param ActionInput $input + * @param array $input * @return DatabaseDeploymentData */ public static function attributes(array $input): array @@ -60,7 +60,7 @@ final readonly class DeployServerDatabase implements DeploysServerDatabases } /** - * @param ActionInput $input + * @param array $input * * @throws Throwable * @throws TooManyDatabasesException diff --git a/app/Actions/Databases/UpdateDatabaseHost.php b/app/Actions/Databases/UpdateDatabaseHost.php index a593b87a5..de1e0013f 100644 --- a/app/Actions/Databases/UpdateDatabaseHost.php +++ b/app/Actions/Databases/UpdateDatabaseHost.php @@ -20,7 +20,7 @@ final readonly class UpdateDatabaseHost implements UpdatesDatabaseHosts /** * Update a database host and persist to the database. * - * @param ActionInput $input + * @param array $input * * @throws Throwable */ diff --git a/app/Actions/Eggs/CreateEgg.php b/app/Actions/Eggs/CreateEgg.php index 56e2ba4f9..5513ae999 100644 --- a/app/Actions/Eggs/CreateEgg.php +++ b/app/Actions/Eggs/CreateEgg.php @@ -64,7 +64,7 @@ final readonly class CreateEgg implements CreatesEggs * not given, so a new egg takes the column defaults and an updated one keeps its stored * values; a blank one is cleared. * - * @param ActionInput $input + * @param array $input * @return array{name: string, description: string|null, docker_images: array, force_outgoing_ip: bool, features: list, startup: string, file_denylist?: list, config_from?: int|null, config_stop?: string|null, config_startup?: string|null, config_logs?: string|null, config_files?: string|null} */ public static function attributes(array $input): array @@ -114,7 +114,7 @@ final readonly class CreateEgg implements CreatesEggs /** * Create an egg, stamping the configured service author. * - * @param ActionInput $input + * @param array $input */ public function create(array $input): Egg { diff --git a/app/Actions/Eggs/Scripts/UpdateInstallScript.php b/app/Actions/Eggs/Scripts/UpdateInstallScript.php index 572d11dcd..da26efff4 100644 --- a/app/Actions/Eggs/Scripts/UpdateInstallScript.php +++ b/app/Actions/Eggs/Scripts/UpdateInstallScript.php @@ -33,7 +33,7 @@ final class UpdateInstallScript implements UpdatesEggInstallScripts * Validates install script input and returns the attributes it changes: only the fields * given, so the rest keep their stored values. A blank script or copy source is cleared. * - * @param ActionInput $input + * @param array $input * @return array{script_install?: string|null, script_is_privileged?: bool, script_entry?: string, script_container?: string, copy_script_from?: int|null} */ public static function attributes(array $input): array @@ -67,7 +67,7 @@ final class UpdateInstallScript implements UpdatesEggInstallScripts /** * Modify the install script for a given Egg. * - * @param ActionInput $input + * @param array $input * * @throws InvalidCopyFromException */ diff --git a/app/Actions/Eggs/UpdateEgg.php b/app/Actions/Eggs/UpdateEgg.php index 52c7daf94..73f50d928 100644 --- a/app/Actions/Eggs/UpdateEgg.php +++ b/app/Actions/Eggs/UpdateEgg.php @@ -17,7 +17,7 @@ final readonly class UpdateEgg implements UpdatesEggs /** * Update an egg with the fields it is created with. * - * @param ActionInput $input + * @param array $input */ public function update(Egg $egg, array $input): Egg { diff --git a/app/Actions/Eggs/Variables/CreateEggVariable.php b/app/Actions/Eggs/Variables/CreateEggVariable.php index 6df53537f..4033e60c8 100644 --- a/app/Actions/Eggs/Variables/CreateEggVariable.php +++ b/app/Actions/Eggs/Variables/CreateEggVariable.php @@ -45,7 +45,7 @@ final class CreateEggVariable implements CreatesEggVariables * The options become the user_viewable and user_editable flags, each set only when it is * listed; any other option is ignored. A variable given no description gets a blank one. * - * @param ActionInput $input + * @param array $input * @return array{name: string, description: string, env_variable: string, default_value: string, user_viewable: bool, user_editable: bool, rules: string} */ public static function attributes(array $input, Egg $egg, ?EggVariable $ignore = null): array @@ -68,7 +68,7 @@ final class CreateEggVariable implements CreatesEggVariables /** * Create a new variable for a given Egg. * - * @param ActionInput $input + * @param array $input */ public function create(Egg $egg, array $input): EggVariable { diff --git a/app/Actions/Eggs/Variables/ReorderEggVariables.php b/app/Actions/Eggs/Variables/ReorderEggVariables.php index d054f0c38..6944d59ee 100644 --- a/app/Actions/Eggs/Variables/ReorderEggVariables.php +++ b/app/Actions/Eggs/Variables/ReorderEggVariables.php @@ -29,7 +29,7 @@ final readonly class ReorderEggVariables implements ReordersEggVariables /** * Validates variable ids under `order` and returns them as integers. * - * @param list $order + * @param list $order * @return list */ public static function order(array $order): array @@ -39,7 +39,7 @@ final readonly class ReorderEggVariables implements ReordersEggVariables return array_map(fn (int|string $key): int => $input->integer('order.'.$key), array_keys($input->array('order'))); } - /** @param list $order */ + /** @param list $order */ public function reorder(Egg $egg, array $order): void { $order = self::order($order); diff --git a/app/Actions/Eggs/Variables/UpdateEggVariable.php b/app/Actions/Eggs/Variables/UpdateEggVariable.php index 41dc77f9e..de4f4c10d 100644 --- a/app/Actions/Eggs/Variables/UpdateEggVariable.php +++ b/app/Actions/Eggs/Variables/UpdateEggVariable.php @@ -13,7 +13,7 @@ final class UpdateEggVariable implements UpdatesEggVariables /** * Update an egg variable with the fields it is created with. * - * @param ActionInput $input + * @param array $input */ public function update(EggVariable $variable, array $input): EggVariable { diff --git a/app/Actions/Files/ChangeFilePermissions.php b/app/Actions/Files/ChangeFilePermissions.php index be8243576..8b95080bd 100644 --- a/app/Actions/Files/ChangeFilePermissions.php +++ b/app/Actions/Files/ChangeFilePermissions.php @@ -11,7 +11,7 @@ use Pterodactyl\Models\Server; final readonly class ChangeFilePermissions implements ChangesFilePermissions { - /** @param array $files */ + /** @param array $files */ public function change(Server $server, ?string $root, array $files): void { Daemon::server($server)->files()->chmodFiles($root, $files); diff --git a/app/Actions/Files/CompressFiles.php b/app/Actions/Files/CompressFiles.php index 7868dc36a..20055d95c 100644 --- a/app/Actions/Files/CompressFiles.php +++ b/app/Actions/Files/CompressFiles.php @@ -12,7 +12,7 @@ use Pterodactyl\Models\Server; final readonly class CompressFiles implements CompressesFiles { /** - * @param array $files + * @param array $files * @return DaemonFileObject */ public function compress(Server $server, ?string $root, array $files): array diff --git a/app/Actions/Files/DeleteFiles.php b/app/Actions/Files/DeleteFiles.php index 6f6c90810..b13ff1011 100644 --- a/app/Actions/Files/DeleteFiles.php +++ b/app/Actions/Files/DeleteFiles.php @@ -11,7 +11,7 @@ use Pterodactyl\Models\Server; final readonly class DeleteFiles implements DeletesFiles { - /** @param array $files */ + /** @param array $files */ public function delete(Server $server, ?string $root, array $files): void { Daemon::server($server)->files()->deleteFiles($root, $files); diff --git a/app/Actions/Files/PullFile.php b/app/Actions/Files/PullFile.php index cb49fc829..9d7643b27 100644 --- a/app/Actions/Files/PullFile.php +++ b/app/Actions/Files/PullFile.php @@ -11,7 +11,7 @@ use Pterodactyl\Models\Server; final readonly class PullFile implements PullsFiles { - /** @param array $options */ + /** @param array $options */ public function pull(Server $server, string $url, ?string $directory, array $options): void { Daemon::server($server)->files()->pull($url, $directory, $options); diff --git a/app/Actions/Files/RenameFiles.php b/app/Actions/Files/RenameFiles.php index 00861a351..2bd3eed0e 100644 --- a/app/Actions/Files/RenameFiles.php +++ b/app/Actions/Files/RenameFiles.php @@ -11,7 +11,7 @@ use Pterodactyl\Models\Server; final readonly class RenameFiles implements RenamesFiles { - /** @param array $files */ + /** @param array $files */ public function rename(Server $server, ?string $root, array $files): void { Daemon::server($server)->files()->renameFiles($root, $files); diff --git a/app/Actions/Locations/CreateLocation.php b/app/Actions/Locations/CreateLocation.php index 39b7087b9..582fa9ad2 100644 --- a/app/Actions/Locations/CreateLocation.php +++ b/app/Actions/Locations/CreateLocation.php @@ -33,7 +33,7 @@ final readonly class CreateLocation implements CreatesLocations /** * Validates location input and returns the model attributes it describes. * - * @param ActionInput $input + * @param array $input * @return array{short: string, long: string|null} */ public static function attributes(array $input, ?Location $location = null): array @@ -47,7 +47,7 @@ final readonly class CreateLocation implements CreatesLocations } /** - * @param ActionInput $input + * @param array $input */ public function create(array $input): Location { diff --git a/app/Actions/Locations/UpdateLocation.php b/app/Actions/Locations/UpdateLocation.php index 4d6d0c292..89af5ed6b 100644 --- a/app/Actions/Locations/UpdateLocation.php +++ b/app/Actions/Locations/UpdateLocation.php @@ -15,7 +15,7 @@ final readonly class UpdateLocation implements UpdatesLocations public function __construct(private ExtensionFields $extensions) {} /** - * @param ActionInput $input + * @param array $input */ public function update(Location $location, array $input): Location { diff --git a/app/Actions/Mounts/AttachEggsToMount.php b/app/Actions/Mounts/AttachEggsToMount.php index b7dd4d682..4c132329e 100644 --- a/app/Actions/Mounts/AttachEggsToMount.php +++ b/app/Actions/Mounts/AttachEggsToMount.php @@ -31,7 +31,7 @@ final readonly class AttachEggsToMount implements AttachesEggsToMounts /** * Attach eggs to a mount, keeping any eggs already attached. * - * @param list $eggIds + * @param list $eggIds */ public function attach(Mount $mount, array $eggIds): void { @@ -43,7 +43,7 @@ final readonly class AttachEggsToMount implements AttachesEggsToMounts * egg; they are all looked up in one query, and a missing one fails `eggs.N` as an exists * rule would. * - * @param list $eggIds + * @param list $eggIds * @return list */ private function eggIds(array $eggIds): array diff --git a/app/Actions/Mounts/AttachNodesToMount.php b/app/Actions/Mounts/AttachNodesToMount.php index 5c826e0c0..96ec46c97 100644 --- a/app/Actions/Mounts/AttachNodesToMount.php +++ b/app/Actions/Mounts/AttachNodesToMount.php @@ -31,7 +31,7 @@ final readonly class AttachNodesToMount implements AttachesNodesToMounts /** * Attach nodes to a mount, keeping any nodes already attached. * - * @param list $nodeIds + * @param list $nodeIds */ public function attach(Mount $mount, array $nodeIds): void { @@ -43,7 +43,7 @@ final readonly class AttachNodesToMount implements AttachesNodesToMounts * node; they are all looked up in one query, and a missing one fails `nodes.N` as an * exists rule would. * - * @param list $nodeIds + * @param list $nodeIds * @return list */ private function nodeIds(array $nodeIds): array diff --git a/app/Actions/Mounts/CreateMount.php b/app/Actions/Mounts/CreateMount.php index 2e49c3baa..c5c277908 100644 --- a/app/Actions/Mounts/CreateMount.php +++ b/app/Actions/Mounts/CreateMount.php @@ -63,7 +63,7 @@ final readonly class CreateMount implements CreatesMounts * stored as given. The description and flags are left out when they are not given, so an * updated mount keeps its stored values; a blank description is cleared. * - * @param ActionInput $input + * @param array $input * @return array{name: string, source: string, target: string, description?: string|null, read_only?: bool, user_mountable?: bool} */ public static function attributes(array $input, ?Mount $mount = null): array @@ -94,7 +94,7 @@ final readonly class CreateMount implements CreatesMounts /** * Create a new mount, assigning it a fresh UUID. * - * @param ActionInput $input + * @param array $input */ public function create(array $input): Mount { diff --git a/app/Actions/Mounts/UpdateMount.php b/app/Actions/Mounts/UpdateMount.php index 5149d68d8..169873a6f 100644 --- a/app/Actions/Mounts/UpdateMount.php +++ b/app/Actions/Mounts/UpdateMount.php @@ -15,7 +15,7 @@ final readonly class UpdateMount implements UpdatesMounts public function __construct(private ExtensionFields $extensions) {} /** - * @param ActionInput $input + * @param array $input */ public function update(Mount $mount, array $input): Mount { diff --git a/app/Actions/Nodes/CreateNode.php b/app/Actions/Nodes/CreateNode.php index 3b7dc0f05..9560c7f1f 100644 --- a/app/Actions/Nodes/CreateNode.php +++ b/app/Actions/Nodes/CreateNode.php @@ -51,7 +51,7 @@ final readonly class CreateNode implements CreatesNodes * upload size are left out when they are not given, so a new node takes the column defaults * and an updated one keeps its stored values; a blank description is cleared. * - * @param ActionInput $input + * @param array $input * @return array{name: string, location_id: int, fqdn: string, scheme: string, memory: int, memory_overallocate: int, disk: int, disk_overallocate: int, daemonListen: int, daemonSFTP: int, daemonBase: string, description?: string|null, public?: bool, behind_proxy?: bool, maintenance_mode?: bool, upload_size?: int} */ public static function attributes(array $input): array @@ -98,7 +98,7 @@ final readonly class CreateNode implements CreatesNodes /** * Create a node and mint its daemon token pair. * - * @param ActionInput $input + * @param array $input */ public function create(array $input): Node { diff --git a/app/Actions/Nodes/UpdateNode.php b/app/Actions/Nodes/UpdateNode.php index fc13243aa..bfd3a8d61 100644 --- a/app/Actions/Nodes/UpdateNode.php +++ b/app/Actions/Nodes/UpdateNode.php @@ -24,7 +24,7 @@ final readonly class UpdateNode implements UpdatesNodes /** * Update the configuration values for a given node on the machine. * - * @param ActionInput $input + * @param array $input * * @throws Throwable */ diff --git a/app/Actions/Schedules/CreateSchedule.php b/app/Actions/Schedules/CreateSchedule.php index 5ac3c1738..5dfbbbbf0 100644 --- a/app/Actions/Schedules/CreateSchedule.php +++ b/app/Actions/Schedules/CreateSchedule.php @@ -38,7 +38,7 @@ final class CreateSchedule implements CreatesSchedules /** * Validates schedule input and returns the model attributes it describes. * - * @param ActionInput $input + * @param array $input * @return array{name: string, cron_minute: string, cron_hour: string, cron_day_of_month: string, cron_month: string, cron_day_of_week: string, is_active: bool, only_when_online: bool, next_run_at: CarbonImmutable} * * @throws DisplayException @@ -70,7 +70,7 @@ final class CreateSchedule implements CreatesSchedules } /** - * @param ActionInput $input + * @param array $input * * @throws DisplayException */ diff --git a/app/Actions/Schedules/CreateScheduleTask.php b/app/Actions/Schedules/CreateScheduleTask.php index f2b66ef6c..31e0baa57 100644 --- a/app/Actions/Schedules/CreateScheduleTask.php +++ b/app/Actions/Schedules/CreateScheduleTask.php @@ -43,7 +43,7 @@ final readonly class CreateScheduleTask implements CreatesScheduleTasks * Validates task input for a schedule and returns the model attributes it describes. * A backup task is refused while the server cannot hold any backups. * - * @param ActionInput $input + * @param array $input * @return array{action: string, payload: string, time_offset: int, continue_on_failure: bool, sequence_id: int|null} * * @throws HttpForbiddenException @@ -68,7 +68,7 @@ final readonly class CreateScheduleTask implements CreatesScheduleTasks * Appends a task to the schedule, or slots it into the requested position by * shifting the tasks that follow it. * - * @param ActionInput $input + * @param array $input * * @throws HttpForbiddenException * @throws ServiceLimitExceededException diff --git a/app/Actions/Schedules/UpdateSchedule.php b/app/Actions/Schedules/UpdateSchedule.php index 42dc1256a..61d53efa7 100644 --- a/app/Actions/Schedules/UpdateSchedule.php +++ b/app/Actions/Schedules/UpdateSchedule.php @@ -12,7 +12,7 @@ use Pterodactyl\Models\Schedule; final class UpdateSchedule implements UpdatesSchedules { /** - * @param ActionInput $input + * @param array $input * * @throws DisplayException */ diff --git a/app/Actions/Schedules/UpdateScheduleTask.php b/app/Actions/Schedules/UpdateScheduleTask.php index 71fc0bf05..8822799c5 100644 --- a/app/Actions/Schedules/UpdateScheduleTask.php +++ b/app/Actions/Schedules/UpdateScheduleTask.php @@ -18,7 +18,7 @@ final readonly class UpdateScheduleTask implements UpdatesScheduleTasks * Updates the task and, when its position changes, shifts the tasks between the * old and new positions to keep the sequence contiguous. * - * @param ActionInput $input + * @param array $input * * @throws HttpForbiddenException * @throws Throwable diff --git a/app/Actions/Servers/CreateServer.php b/app/Actions/Servers/CreateServer.php index ff53b0c7d..6271e8f54 100644 --- a/app/Actions/Servers/CreateServer.php +++ b/app/Actions/Servers/CreateServer.php @@ -36,7 +36,7 @@ use Ramsey\Uuid\Uuid; use Throwable; /** - * @phpstan-type CreationAttributes array{external_id: string|null, name: string, description: string, owner_id: int, egg_id: int, image: string, startup: string, environment: array, skip_scripts: bool, oom_disabled: bool, memory: int, swap: int, disk: int, io: int, threads: string|null, cpu: int, database_limit: int, allocation_limit: int, backup_limit: int, allocation_id: int|null, allocation_additional: list, start_on_completion: bool} + * @phpstan-type CreationAttributes array{external_id: string|null, name: string, description: string, owner_id: int, egg_id: int, image: string, startup: string, environment: array, skip_scripts: bool, oom_disabled: bool, memory: int, swap: int, disk: int, io: int, threads: string|null, cpu: int, database_limit: int, allocation_limit: int, backup_limit: int, allocation_id: int|null, allocation_additional: list, start_on_completion: bool} */ final readonly class CreateServer implements CreatesServers { @@ -94,7 +94,7 @@ final readonly class CreateServer implements CreatesServers * left out is 0. A server given no OOM flag, or null, has the OOM killer disabled. The * environment keeps each value as it was given, for the egg's variable rules to check. * - * @param ActionInput $input + * @param array $input * @return CreationAttributes */ public static function attributes(array $input, ?DeploymentObject $deployment = null): array @@ -138,7 +138,7 @@ final readonly class CreateServer implements CreatesServers } /** - * @param ActionInput $input + * @param array $input * * @throws Throwable * @throws DisplayException diff --git a/app/Actions/Servers/UpdateServerBuild.php b/app/Actions/Servers/UpdateServerBuild.php index 331199e5e..11d3ae946 100644 --- a/app/Actions/Servers/UpdateServerBuild.php +++ b/app/Actions/Servers/UpdateServerBuild.php @@ -62,7 +62,7 @@ final readonly class UpdateServerBuild implements UpdatesServerBuild * fields given are validated and changed, except the feature limits: a database or * allocation limit left out or null is cleared, and a backup limit becomes 0. * - * @param ActionInput $input + * @param array $input * @return BuildAttributes */ public static function attributes(array $input, Server $server): array @@ -104,7 +104,7 @@ final readonly class UpdateServerBuild implements UpdatesServerBuild } /** - * @param ActionInput $input + * @param array $input * * @throws Throwable * @throws DisplayException diff --git a/app/Actions/Servers/UpdateServerDetails.php b/app/Actions/Servers/UpdateServerDetails.php index 172e0c8ae..a514a5559 100644 --- a/app/Actions/Servers/UpdateServerDetails.php +++ b/app/Actions/Servers/UpdateServerDetails.php @@ -43,7 +43,7 @@ final readonly class UpdateServerDetails implements UpdatesServerDetails * detail is replaced: an external id left out or empty is cleared, and a description * left out or null becomes empty. * - * @param ActionInput $input + * @param array $input * @return array{external_id: string|null, owner_id: int, name: string, description: string} */ public static function attributes(array $input, ?Server $server = null): array @@ -59,7 +59,7 @@ final readonly class UpdateServerDetails implements UpdatesServerDetails } /** - * @param ActionInput $input + * @param array $input * * @throws Throwable */ diff --git a/app/Actions/Servers/UpdateServerStartup.php b/app/Actions/Servers/UpdateServerStartup.php index 55f1f5c72..24add6a53 100644 --- a/app/Actions/Servers/UpdateServerStartup.php +++ b/app/Actions/Servers/UpdateServerStartup.php @@ -19,7 +19,7 @@ use Pterodactyl\Support\JsonValueGuard; use Throwable; /** - * @phpstan-type StartupAttributes array{environment: array, egg_id?: int, startup?: string, docker_image?: string, skip_scripts?: bool} + * @phpstan-type StartupAttributes array{environment: array, egg_id?: int, startup?: string, docker_image?: string, skip_scripts?: bool} */ final readonly class UpdateServerStartup implements UpdatesServerStartup { @@ -60,7 +60,7 @@ final readonly class UpdateServerStartup implements UpdatesServerStartup * Only the fields given are validated, and fields above the user level are ignored. The * environment keeps each value as it was given, for the egg's variable rules to check. * - * @param ActionInput $input + * @param array $input * @return StartupAttributes */ public static function attributes(array $input, int $userLevel = User::USER_LEVEL_USER): array @@ -100,7 +100,7 @@ final readonly class UpdateServerStartup implements UpdatesServerStartup } /** - * @param ActionInput $input + * @param array $input * * @throws Throwable */ diff --git a/app/Actions/Subusers/CreateSubuser.php b/app/Actions/Subusers/CreateSubuser.php index a3e654c19..c74921061 100644 --- a/app/Actions/Subusers/CreateSubuser.php +++ b/app/Actions/Subusers/CreateSubuser.php @@ -46,7 +46,7 @@ final readonly class CreateSubuser implements CreatesSubusers * Validates subuser input and returns the email address and the permissions it * describes, each permission one of the grantable keys. * - * @param ActionInput $input + * @param array $input * @param list $grantable * @return array{email: string, permissions: list} */ diff --git a/app/Actions/Tags/CreateTag.php b/app/Actions/Tags/CreateTag.php index 1a4181afe..89d2f789b 100644 --- a/app/Actions/Tags/CreateTag.php +++ b/app/Actions/Tags/CreateTag.php @@ -36,7 +36,7 @@ final readonly class CreateTag implements CreatesTags * nest id are left out when they are not given, so an edited tag keeps its stored values; * a blank colour is cleared. * - * @param ActionInput $input + * @param array $input * @return array{name: string, slug: string, color?: string|null, legacy_nest_id?: int|null} */ public static function attributes(array $input, ?Tag $tag = null): array @@ -60,7 +60,7 @@ final readonly class CreateTag implements CreatesTags } /** - * @param ActionInput $input + * @param array $input */ public function create(array $input): Tag { diff --git a/app/Actions/Tags/SyncTags.php b/app/Actions/Tags/SyncTags.php index 698e868e9..5c6de0d53 100644 --- a/app/Actions/Tags/SyncTags.php +++ b/app/Actions/Tags/SyncTags.php @@ -48,7 +48,7 @@ final readonly class SyncTags implements SyncsTags * Validates tag values under `tags` and returns them as strings for the resolver, an * integer id becoming the numeric string the panel sends. * - * @param list $values + * @param list $values * @return list */ public static function values(array $values): array @@ -58,19 +58,19 @@ final readonly class SyncTags implements SyncsTags return array_map(fn (int|string $key): string => $input->string('tags.'.$key)->toString(), array_keys($input->array('tags'))); } - /** @param list $values */ + /** @param list $values */ public function syncEgg(Egg $egg, array $values): void { $this->sync($egg, $egg->tags(), self::values($values)); } - /** @param list $values */ + /** @param list $values */ public function syncNodeGames(Node $node, array $values): void { $this->sync($node, $node->eggTags(), self::values($values), $node->deploymentTags()); } - /** @param list $values */ + /** @param list $values */ public function syncNodeDeployments(Node $node, array $values): void { $this->sync($node, $node->deploymentTags(), self::values($values), $node->eggTags()); diff --git a/app/Actions/Tags/UpdateTag.php b/app/Actions/Tags/UpdateTag.php index d78031adc..57802e073 100644 --- a/app/Actions/Tags/UpdateTag.php +++ b/app/Actions/Tags/UpdateTag.php @@ -16,7 +16,7 @@ final readonly class UpdateTag implements UpdatesTags * and its presentation comes from the EggSpecificTags enum, so it must never be renamed or * relabelled. * - * @param ActionInput $input + * @param array $input * * @throws DisplayException */ diff --git a/app/Actions/Users/CreateSshKey.php b/app/Actions/Users/CreateSshKey.php index ac88a7e1a..80e749f90 100644 --- a/app/Actions/Users/CreateSshKey.php +++ b/app/Actions/Users/CreateSshKey.php @@ -54,7 +54,7 @@ final readonly class CreateSshKey implements CreatesSshKeys /** * Validates SSH key input and returns the key it describes. * - * @param ActionInput $input + * @param array $input * @return array{name: string, public_key: string, fingerprint: string} */ public static function attributes(array $input): array diff --git a/app/Actions/Users/CreateUser.php b/app/Actions/Users/CreateUser.php index 1be734709..d2601fbd5 100644 --- a/app/Actions/Users/CreateUser.php +++ b/app/Actions/Users/CreateUser.php @@ -61,7 +61,7 @@ final readonly class CreateUser implements CreatesUsers * being updated, only the fields in the input are validated and returned, so the rest * keep their stored values. A blank password is left out. * - * @param ActionInput $input + * @param array $input * @return array{email?: string, username?: string, name_first?: string, name_last?: string, external_id?: string|null, password?: string, root_admin?: bool, language?: string} */ public static function attributes(array $input, ?User $user = null): array @@ -119,7 +119,7 @@ final readonly class CreateUser implements CreatesUsers * The UUID and password hash are handled by the model itself (HasVersion4Uuids * and the hashed password cast). * - * @param ActionInput $input + * @param array $input * * @throws Throwable */ diff --git a/app/Actions/Users/UpdateUser.php b/app/Actions/Users/UpdateUser.php index 1d0234df6..f5380bdb1 100644 --- a/app/Actions/Users/UpdateUser.php +++ b/app/Actions/Users/UpdateUser.php @@ -20,7 +20,7 @@ final readonly class UpdateUser implements UpdatesUsers * Update the user model instance and return the updated model. The hashed * password cast on the model takes care of hashing a new password. * - * @param ActionInput $input + * @param array $input * * @throws Throwable */ diff --git a/app/Contracts/Activity/IngestsActivityLogs.php b/app/Contracts/Activity/IngestsActivityLogs.php index 8addf9bb9..17bea7523 100644 --- a/app/Contracts/Activity/IngestsActivityLogs.php +++ b/app/Contracts/Activity/IngestsActivityLogs.php @@ -15,7 +15,7 @@ interface IngestsActivityLogs * come straight from any caller. Events for servers on other nodes, and events outside * the `server:` namespace, are dropped. * - * @param ActionInput $input data: the events, each with server, event, metadata and timestamp, and optionally user and ip + * @param array $input data: the events, each with server, event, metadata and timestamp, and optionally user and ip * * @throws ValidationException */ diff --git a/app/Contracts/Allocations/CreatesAllocations.php b/app/Contracts/Allocations/CreatesAllocations.php index 73c0ae616..82cdf5b6f 100644 --- a/app/Contracts/Allocations/CreatesAllocations.php +++ b/app/Contracts/Allocations/CreatesAllocations.php @@ -18,7 +18,7 @@ interface CreatesAllocations * come straight from any caller. A port that cannot be read, falls outside 1025-65535 or * opens a range of more than 1000 ports is refused with the exceptions below. * - * @param ActionInput $input allocation_ip (an IP address, CIDR range or hostname), allocation_ports (port numbers, or ranges such as "25565-25570") and optionally allocation_alias + * @param array $input allocation_ip (an IP address, CIDR range or hostname), allocation_ports (port numbers, or ranges such as "25565-25570") and optionally allocation_alias * * @throws DisplayException * @throws CidrOutOfRangeException diff --git a/app/Contracts/Api/CreatesApiKeys.php b/app/Contracts/Api/CreatesApiKeys.php index 16e59e3ba..a1f1ac75a 100644 --- a/app/Contracts/Api/CreatesApiKeys.php +++ b/app/Contracts/Api/CreatesApiKeys.php @@ -15,8 +15,8 @@ interface CreatesApiKeys * application keys: each is AdminAcl::NONE or AdminAcl::READ and AdminAcl::WRITE * combined, and a resource left out gets AdminAcl::NONE. * - * @param ActionInput $input memo and user_id, and optionally allowed_ips - * @param ActionInput $permissions the r_* column of any AdminAcl resource + * @param array $input memo and user_id, and optionally allowed_ips + * @param array $permissions the r_* column of any AdminAcl resource */ public function create(int $keyType, array $input, array $permissions = []): ApiKey; } diff --git a/app/Contracts/Api/UpdatesApiKeys.php b/app/Contracts/Api/UpdatesApiKeys.php index 4c3dfb3e6..ea11014e3 100644 --- a/app/Contracts/Api/UpdatesApiKeys.php +++ b/app/Contracts/Api/UpdatesApiKeys.php @@ -13,8 +13,8 @@ interface UpdatesApiKeys * permissions are validated here, so they can come straight from any caller. Only what * is given changes, and the permissions are only applied to application keys. * - * @param ActionInput $input optionally memo - * @param ActionInput $permissions the r_* column of any AdminAcl resource + * @param array $input optionally memo + * @param array $permissions the r_* column of any AdminAcl resource */ public function update(ApiKey $key, array $input, array $permissions = []): ApiKey; } diff --git a/app/Contracts/Backups/CompletesBackups.php b/app/Contracts/Backups/CompletesBackups.php index 3efd31016..4b25f91bd 100644 --- a/app/Contracts/Backups/CompletesBackups.php +++ b/app/Contracts/Backups/CompletesBackups.php @@ -17,7 +17,7 @@ interface CompletesBackups * successful backup needs its checksum, checksum type and size; S3 parts left out are * listed from S3 when the multipart upload is completed. * - * @param ActionInput $input successful, checksum, checksum_type, size and optionally parts, each with an etag and part_number + * @param array $input successful, checksum, checksum_type, size and optionally parts, each with an etag and part_number * * @throws DisplayException * @throws ValidationException diff --git a/app/Contracts/Databases/CreatesDatabaseHosts.php b/app/Contracts/Databases/CreatesDatabaseHosts.php index 94ab58b78..23116fd7a 100644 --- a/app/Contracts/Databases/CreatesDatabaseHosts.php +++ b/app/Contracts/Databases/CreatesDatabaseHosts.php @@ -15,7 +15,7 @@ interface CreatesDatabaseHosts * extension field values go under `extensions` as ValidatedExtensionValues. The password * is stored encrypted, and a host given no node_id is global. * - * @param ActionInput $input name, host, port and username, and optionally password and node_id + * @param array $input name, host, port and username, and optionally password and node_id * * @throws Throwable */ diff --git a/app/Contracts/Databases/CreatesDatabases.php b/app/Contracts/Databases/CreatesDatabases.php index a629d2251..2468e51e5 100644 --- a/app/Contracts/Databases/CreatesDatabases.php +++ b/app/Contracts/Databases/CreatesDatabases.php @@ -20,7 +20,7 @@ interface CreatesDatabases * "s{server_id}_" prefix (see DatabaseName::generateUnique()); a database given no * max_connections takes the column default. * - * @param ActionInput $input database, remote and database_host_id, and optionally max_connections + * @param array $input database, remote and database_host_id, and optionally max_connections * * @throws Throwable * @throws TooManyDatabasesException diff --git a/app/Contracts/Databases/DeploysServerDatabases.php b/app/Contracts/Databases/DeploysServerDatabases.php index de0d4b119..f22308a9b 100644 --- a/app/Contracts/Databases/DeploysServerDatabases.php +++ b/app/Contracts/Databases/DeploysServerDatabases.php @@ -20,7 +20,7 @@ interface DeploysServerDatabases * any host when random hosts are allowed. The input is validated here, so it can come * straight from any caller. * - * @param ActionInput $input database and remote, and optionally database_host_id and max_connections + * @param array $input database and remote, and optionally database_host_id and max_connections * * @throws Throwable * @throws TooManyDatabasesException diff --git a/app/Contracts/Databases/UpdatesDatabaseHosts.php b/app/Contracts/Databases/UpdatesDatabaseHosts.php index 287965f2c..d9200b812 100644 --- a/app/Contracts/Databases/UpdatesDatabaseHosts.php +++ b/app/Contracts/Databases/UpdatesDatabaseHosts.php @@ -16,7 +16,7 @@ interface UpdatesDatabaseHosts * stored one, and a host given no node_id becomes global. Extension field values go under * `extensions` as ValidatedExtensionValues. * - * @param ActionInput $input the fields a host is created with + * @param array $input the fields a host is created with * * @throws Throwable */ diff --git a/app/Contracts/Eggs/CreatesEggVariables.php b/app/Contracts/Eggs/CreatesEggVariables.php index f5515d519..b2fbcca5d 100644 --- a/app/Contracts/Eggs/CreatesEggVariables.php +++ b/app/Contracts/Eggs/CreatesEggVariables.php @@ -15,7 +15,7 @@ interface CreatesEggVariables * variables and not one the panel reserves, and the rules must be a valid rule set. * Listing user_viewable or user_editable in options lets users see or edit the variable. * - * @param ActionInput $input name, env_variable, rules and default_value, and optionally description and options + * @param array $input name, env_variable, rules and default_value, and optionally description and options */ public function create(Egg $egg, array $input): EggVariable; } diff --git a/app/Contracts/Eggs/CreatesEggs.php b/app/Contracts/Eggs/CreatesEggs.php index 9ed93108d..28a0cb71a 100644 --- a/app/Contracts/Eggs/CreatesEggs.php +++ b/app/Contracts/Eggs/CreatesEggs.php @@ -15,7 +15,7 @@ interface CreatesEggs * an image optionally prefixed with its display name and a pipe. An egg given a * config_from copies its config from that egg and needs no config blocks of its own. * - * @param ActionInput $input name, docker_images and startup, and optionally description, force_outgoing_ip, features, file_denylist, config_from, config_stop, config_startup, config_logs and config_files + * @param array $input name, docker_images and startup, and optionally description, force_outgoing_ip, features, file_denylist, config_from, config_stop, config_startup, config_logs and config_files */ public function create(array $input): Egg; } diff --git a/app/Contracts/Eggs/ReordersEggVariables.php b/app/Contracts/Eggs/ReordersEggVariables.php index dafb51841..18370b5af 100644 --- a/app/Contracts/Eggs/ReordersEggVariables.php +++ b/app/Contracts/Eggs/ReordersEggVariables.php @@ -13,7 +13,7 @@ interface ReordersEggVariables * validated here, so they can come straight from any caller: each is an integer or a * numeric string, listed once. An id of a variable on another egg is skipped. * - * @param list $order the variable ids in their new order + * @param list $order the variable ids in their new order */ public function reorder(Egg $egg, array $order): void; } diff --git a/app/Contracts/Eggs/UpdatesEggInstallScripts.php b/app/Contracts/Eggs/UpdatesEggInstallScripts.php index 65c527c3c..2d8494649 100644 --- a/app/Contracts/Eggs/UpdatesEggInstallScripts.php +++ b/app/Contracts/Eggs/UpdatesEggInstallScripts.php @@ -14,7 +14,7 @@ interface UpdatesEggInstallScripts * straight from any caller, and only the fields given are changed. An egg to copy the * script from must have a script of its own. * - * @param ActionInput $input any of script_install, script_is_privileged, script_entry, script_container and copy_script_from + * @param array $input any of script_install, script_is_privileged, script_entry, script_container and copy_script_from * * @throws InvalidCopyFromException */ diff --git a/app/Contracts/Eggs/UpdatesEggVariables.php b/app/Contracts/Eggs/UpdatesEggVariables.php index 66ac57ce2..357fbbf43 100644 --- a/app/Contracts/Eggs/UpdatesEggVariables.php +++ b/app/Contracts/Eggs/UpdatesEggVariables.php @@ -15,7 +15,7 @@ interface UpdatesEggVariables * when options lists user_viewable or user_editable. The variable keeps its own * environment variable name without it counting as taken. * - * @param ActionInput $input the fields a variable is created with + * @param array $input the fields a variable is created with */ public function update(EggVariable $variable, array $input): EggVariable; } diff --git a/app/Contracts/Eggs/UpdatesEggs.php b/app/Contracts/Eggs/UpdatesEggs.php index 095d5cc39..63d004277 100644 --- a/app/Contracts/Eggs/UpdatesEggs.php +++ b/app/Contracts/Eggs/UpdatesEggs.php @@ -15,7 +15,7 @@ interface UpdatesEggs * blocks left out keep their stored values. The file denylist cannot be changed here. * Extension field values go under `extensions` as ValidatedExtensionValues. * - * @param ActionInput $input the fields an egg is created with + * @param array $input the fields an egg is created with */ public function update(Egg $egg, array $input): Egg; } diff --git a/app/Contracts/Files/ChangesFilePermissions.php b/app/Contracts/Files/ChangesFilePermissions.php index c187e6465..3408db8ab 100644 --- a/app/Contracts/Files/ChangesFilePermissions.php +++ b/app/Contracts/Files/ChangesFilePermissions.php @@ -8,6 +8,6 @@ use Pterodactyl\Models\Server; interface ChangesFilePermissions { - /** @param array $files */ + /** @param array $files */ public function change(Server $server, ?string $root, array $files): void; } diff --git a/app/Contracts/Files/CompressesFiles.php b/app/Contracts/Files/CompressesFiles.php index 9d5cd1ca5..1f9201b05 100644 --- a/app/Contracts/Files/CompressesFiles.php +++ b/app/Contracts/Files/CompressesFiles.php @@ -9,7 +9,7 @@ use Pterodactyl\Models\Server; interface CompressesFiles { /** - * @param array $files + * @param array $files * @return DaemonFileObject */ public function compress(Server $server, ?string $root, array $files): array; diff --git a/app/Contracts/Files/DeletesFiles.php b/app/Contracts/Files/DeletesFiles.php index 46a4201ca..98adb0921 100644 --- a/app/Contracts/Files/DeletesFiles.php +++ b/app/Contracts/Files/DeletesFiles.php @@ -8,6 +8,6 @@ use Pterodactyl\Models\Server; interface DeletesFiles { - /** @param array $files */ + /** @param array $files */ public function delete(Server $server, ?string $root, array $files): void; } diff --git a/app/Contracts/Files/PullsFiles.php b/app/Contracts/Files/PullsFiles.php index de8a2f2d7..916b028e0 100644 --- a/app/Contracts/Files/PullsFiles.php +++ b/app/Contracts/Files/PullsFiles.php @@ -8,6 +8,6 @@ use Pterodactyl\Models\Server; interface PullsFiles { - /** @param array $options */ + /** @param array $options */ public function pull(Server $server, string $url, ?string $directory, array $options): void; } diff --git a/app/Contracts/Files/RenamesFiles.php b/app/Contracts/Files/RenamesFiles.php index b25593021..87af46261 100644 --- a/app/Contracts/Files/RenamesFiles.php +++ b/app/Contracts/Files/RenamesFiles.php @@ -8,6 +8,6 @@ use Pterodactyl\Models\Server; interface RenamesFiles { - /** @param array $files */ + /** @param array $files */ public function rename(Server $server, ?string $root, array $files): void; } diff --git a/app/Contracts/Locations/CreatesLocations.php b/app/Contracts/Locations/CreatesLocations.php index e6c7bd381..b3249b1b1 100644 --- a/app/Contracts/Locations/CreatesLocations.php +++ b/app/Contracts/Locations/CreatesLocations.php @@ -12,7 +12,7 @@ interface CreatesLocations * Create a new location. The input is validated here, so it can come straight from any caller; * extension field values go under `extensions` as ValidatedExtensionValues. * - * @param ActionInput $input short and long + * @param array $input short and long */ public function create(array $input): Location; } diff --git a/app/Contracts/Locations/UpdatesLocations.php b/app/Contracts/Locations/UpdatesLocations.php index ece7ebc43..a2238119b 100644 --- a/app/Contracts/Locations/UpdatesLocations.php +++ b/app/Contracts/Locations/UpdatesLocations.php @@ -12,7 +12,7 @@ interface UpdatesLocations * Update an existing location. The input is validated here, so it can come straight from any caller; * extension field values go under `extensions` as ValidatedExtensionValues. * - * @param ActionInput $input short and long + * @param array $input short and long */ public function update(Location $location, array $input): Location; } diff --git a/app/Contracts/Mounts/AttachesEggsToMounts.php b/app/Contracts/Mounts/AttachesEggsToMounts.php index c92d426fe..9259d04cd 100644 --- a/app/Contracts/Mounts/AttachesEggsToMounts.php +++ b/app/Contracts/Mounts/AttachesEggsToMounts.php @@ -12,7 +12,7 @@ interface AttachesEggsToMounts * Attach eggs to a mount, keeping any eggs already attached. The ids are validated here, * so they can come straight from any caller; errors are reported under `eggs` and `eggs.N`. * - * @param list $eggIds ids of existing eggs, as integers or numeric strings + * @param list $eggIds ids of existing eggs, as integers or numeric strings */ public function attach(Mount $mount, array $eggIds): void; } diff --git a/app/Contracts/Mounts/AttachesNodesToMounts.php b/app/Contracts/Mounts/AttachesNodesToMounts.php index 314a37bd3..d94007a68 100644 --- a/app/Contracts/Mounts/AttachesNodesToMounts.php +++ b/app/Contracts/Mounts/AttachesNodesToMounts.php @@ -12,7 +12,7 @@ interface AttachesNodesToMounts * Attach nodes to a mount, keeping any nodes already attached. The ids are validated here, * so they can come straight from any caller; errors are reported under `nodes` and `nodes.N`. * - * @param list $nodeIds ids of existing nodes, as integers or numeric strings + * @param list $nodeIds ids of existing nodes, as integers or numeric strings */ public function attach(Mount $mount, array $nodeIds): void; } diff --git a/app/Contracts/Mounts/CreatesMounts.php b/app/Contracts/Mounts/CreatesMounts.php index 3d29fed18..70a736329 100644 --- a/app/Contracts/Mounts/CreatesMounts.php +++ b/app/Contracts/Mounts/CreatesMounts.php @@ -13,7 +13,7 @@ interface CreatesMounts * come straight from any caller; extension field values go under `extensions` as * ValidatedExtensionValues. * - * @param ActionInput $input name, source and target, and optionally description, read_only and user_mountable + * @param array $input name, source and target, and optionally description, read_only and user_mountable */ public function create(array $input): Mount; } diff --git a/app/Contracts/Mounts/UpdatesMounts.php b/app/Contracts/Mounts/UpdatesMounts.php index ecbb35f0d..172385ce5 100644 --- a/app/Contracts/Mounts/UpdatesMounts.php +++ b/app/Contracts/Mounts/UpdatesMounts.php @@ -14,7 +14,7 @@ interface UpdatesMounts * description and flags keep their stored values when they are left out. Extension field * values go under `extensions` as ValidatedExtensionValues. * - * @param ActionInput $input the fields a mount is created with + * @param array $input the fields a mount is created with */ public function update(Mount $mount, array $input): Mount; } diff --git a/app/Contracts/Nodes/CreatesNodes.php b/app/Contracts/Nodes/CreatesNodes.php index dcebced19..52b1d6ecc 100644 --- a/app/Contracts/Nodes/CreatesNodes.php +++ b/app/Contracts/Nodes/CreatesNodes.php @@ -14,7 +14,7 @@ interface CreatesNodes * ValidatedExtensionValues. A node given no daemon_base keeps its files in * /var/lib/pterodactyl/volumes. * - * @param ActionInput $input name, location_id, fqdn, scheme, memory, memory_overallocate, disk, disk_overallocate, daemon_listen and daemon_sftp, and optionally public, description, behind_proxy, maintenance_mode, upload_size and daemon_base + * @param array $input name, location_id, fqdn, scheme, memory, memory_overallocate, disk, disk_overallocate, daemon_listen and daemon_sftp, and optionally public, description, behind_proxy, maintenance_mode, upload_size and daemon_base */ public function create(array $input): Node; } diff --git a/app/Contracts/Nodes/UpdatesNodes.php b/app/Contracts/Nodes/UpdatesNodes.php index 0c663d6b6..4166b232c 100644 --- a/app/Contracts/Nodes/UpdatesNodes.php +++ b/app/Contracts/Nodes/UpdatesNodes.php @@ -19,7 +19,7 @@ interface UpdatesNodes * values when they are left out. Extension field values go under `extensions` as * ValidatedExtensionValues. * - * @param ActionInput $input the fields a node is created with + * @param array $input the fields a node is created with * * @throws Throwable */ diff --git a/app/Contracts/Schedules/CreatesScheduleTasks.php b/app/Contracts/Schedules/CreatesScheduleTasks.php index a2a0012eb..cef2fed42 100644 --- a/app/Contracts/Schedules/CreatesScheduleTasks.php +++ b/app/Contracts/Schedules/CreatesScheduleTasks.php @@ -17,7 +17,7 @@ interface CreatesScheduleTasks * * Validates the input itself, so it can come straight from any caller. * - * @param ActionInput $input action, payload, time_offset, and optionally sequence_id and continue_on_failure + * @param array $input action, payload, time_offset, and optionally sequence_id and continue_on_failure * * @throws ServiceLimitExceededException * @throws Throwable diff --git a/app/Contracts/Schedules/CreatesSchedules.php b/app/Contracts/Schedules/CreatesSchedules.php index 7adbfcb66..4080101e5 100644 --- a/app/Contracts/Schedules/CreatesSchedules.php +++ b/app/Contracts/Schedules/CreatesSchedules.php @@ -13,7 +13,7 @@ interface CreatesSchedules /** * Validates the input itself, so it can come straight from any caller. * - * @param ActionInput $input name, is_active, minute, hour, day_of_month, month, day_of_week and only_when_online + * @param array $input name, is_active, minute, hour, day_of_month, month, day_of_week and only_when_online * * @throws DisplayException */ diff --git a/app/Contracts/Schedules/UpdatesScheduleTasks.php b/app/Contracts/Schedules/UpdatesScheduleTasks.php index 4ca5308a9..a3ed1d121 100644 --- a/app/Contracts/Schedules/UpdatesScheduleTasks.php +++ b/app/Contracts/Schedules/UpdatesScheduleTasks.php @@ -16,7 +16,7 @@ interface UpdatesScheduleTasks * * Validates the input itself, so it can come straight from any caller. * - * @param ActionInput $input action, payload, time_offset, and optionally sequence_id and continue_on_failure + * @param array $input action, payload, time_offset, and optionally sequence_id and continue_on_failure * * @throws Throwable */ diff --git a/app/Contracts/Schedules/UpdatesSchedules.php b/app/Contracts/Schedules/UpdatesSchedules.php index 3eceb1b83..27c962c0d 100644 --- a/app/Contracts/Schedules/UpdatesSchedules.php +++ b/app/Contracts/Schedules/UpdatesSchedules.php @@ -12,7 +12,7 @@ interface UpdatesSchedules /** * Validates the input itself, so it can come straight from any caller. * - * @param ActionInput $input the same fields a schedule is created with + * @param array $input the same fields a schedule is created with * * @throws DisplayException */ diff --git a/app/Contracts/Servers/CreatesServers.php b/app/Contracts/Servers/CreatesServers.php index 1aaa2469f..650a060ac 100644 --- a/app/Contracts/Servers/CreatesServers.php +++ b/app/Contracts/Servers/CreatesServers.php @@ -21,7 +21,7 @@ interface CreatesServers * checked against the egg's variable rules. Without a deployment the server takes the * allocation_id given; with one, the deployment picks its node and default allocation. * - * @param ActionInput $input name, owner_id, egg_id, image, startup, memory, swap, disk, io, cpu and, without a deployment, allocation_id, and optionally external_id, description, environment, skip_scripts, oom_disabled, threads, database_limit, allocation_limit, backup_limit, allocation_additional and start_on_completion + * @param array $input name, owner_id, egg_id, image, startup, memory, swap, disk, io, cpu and, without a deployment, allocation_id, and optionally external_id, description, environment, skip_scripts, oom_disabled, threads, database_limit, allocation_limit, backup_limit, allocation_additional and start_on_completion * * @throws Throwable * @throws DisplayException diff --git a/app/Contracts/Servers/UpdatesServerBuild.php b/app/Contracts/Servers/UpdatesServerBuild.php index 5abb63f29..b79d32529 100644 --- a/app/Contracts/Servers/UpdatesServerBuild.php +++ b/app/Contracts/Servers/UpdatesServerBuild.php @@ -17,7 +17,7 @@ interface UpdatesServerBuild * out becomes 0. Allocations to add are assigned only when they are free and on the * server's node; removing the default allocation needs a newly added one to replace it. * - * @param ActionInput $input any of allocation_id, oom_disabled, memory, swap, io, cpu, threads, disk, add_allocations, remove_allocations, database_limit, allocation_limit and backup_limit + * @param array $input any of allocation_id, oom_disabled, memory, swap, io, cpu, threads, disk, add_allocations, remove_allocations, database_limit, allocation_limit and backup_limit * * @throws Throwable * @throws DisplayException diff --git a/app/Contracts/Servers/UpdatesServerDetails.php b/app/Contracts/Servers/UpdatesServerDetails.php index bec0eaa45..3fb4cd2f4 100644 --- a/app/Contracts/Servers/UpdatesServerDetails.php +++ b/app/Contracts/Servers/UpdatesServerDetails.php @@ -16,7 +16,7 @@ interface UpdatesServerDetails * the previous one. Extension field values go under `extensions` as * ValidatedExtensionValues. * - * @param ActionInput $input name and owner_id, and optionally external_id and description + * @param array $input name and owner_id, and optionally external_id and description * * @throws Throwable */ diff --git a/app/Contracts/Servers/UpdatesServerStartup.php b/app/Contracts/Servers/UpdatesServerStartup.php index 206cce861..59c4d6d40 100644 --- a/app/Contracts/Servers/UpdatesServerStartup.php +++ b/app/Contracts/Servers/UpdatesServerStartup.php @@ -18,7 +18,7 @@ interface UpdatesServerStartup * startup command, egg, Docker image and install script flag; at the admin level an * install script flag left out turns it off. * - * @param ActionInput $input any of environment and, at the admin level, startup, egg_id, docker_image and skip_scripts + * @param array $input any of environment and, at the admin level, startup, egg_id, docker_image and skip_scripts * * @throws Throwable */ diff --git a/app/Contracts/Tags/CreatesTags.php b/app/Contracts/Tags/CreatesTags.php index 2feebf0ea..739bb8418 100644 --- a/app/Contracts/Tags/CreatesTags.php +++ b/app/Contracts/Tags/CreatesTags.php @@ -11,7 +11,7 @@ interface CreatesTags /** * Create a new tag. The input is validated here, so it can come straight from any caller. * - * @param ActionInput $input name and slug, and optionally color and legacy_nest_id + * @param array $input name and slug, and optionally color and legacy_nest_id */ public function create(array $input): Tag; } diff --git a/app/Contracts/Tags/SyncsTags.php b/app/Contracts/Tags/SyncsTags.php index f2dde92da..896331490 100644 --- a/app/Contracts/Tags/SyncsTags.php +++ b/app/Contracts/Tags/SyncsTags.php @@ -15,20 +15,20 @@ use Pterodactyl\Models\Node; */ interface SyncsTags { - /** @param list $values */ + /** @param list $values */ public function syncEgg(Egg $egg, array $values): void; /** * Replace the games a node accepts. A tag the node holds as a reservation is refused. * - * @param list $values + * @param list $values */ public function syncNodeGames(Node $node, array $values): void; /** * Replace the reservations on a node. A tag the node accepts as a game is refused. * - * @param list $values + * @param list $values */ public function syncNodeDeployments(Node $node, array $values): void; } diff --git a/app/Contracts/Tags/UpdatesTags.php b/app/Contracts/Tags/UpdatesTags.php index 918fc2d98..1ab3ce75a 100644 --- a/app/Contracts/Tags/UpdatesTags.php +++ b/app/Contracts/Tags/UpdatesTags.php @@ -15,7 +15,7 @@ interface UpdatesTags * required ones included; the colour and legacy nest id keep their stored values when they * are left out. * - * @param ActionInput $input the fields a tag is created with + * @param array $input the fields a tag is created with * * @throws DisplayException */ diff --git a/app/Contracts/Users/CreatesUsers.php b/app/Contracts/Users/CreatesUsers.php index 6eda48a23..9d70fe339 100644 --- a/app/Contracts/Users/CreatesUsers.php +++ b/app/Contracts/Users/CreatesUsers.php @@ -19,7 +19,7 @@ interface CreatesUsers * The input is validated here, so it can come straight from any caller; extension * field values go under `extensions` as ValidatedExtensionValues. * - * @param ActionInput $input email, username, name_first, name_last, and optionally external_id, password, root_admin and language + * @param array $input email, username, name_first, name_last, and optionally external_id, password, root_admin and language * * @throws Throwable */ diff --git a/app/Contracts/Users/UpdatesUsers.php b/app/Contracts/Users/UpdatesUsers.php index 5194e4d3f..be0f1d040 100644 --- a/app/Contracts/Users/UpdatesUsers.php +++ b/app/Contracts/Users/UpdatesUsers.php @@ -17,7 +17,7 @@ interface UpdatesUsers * given are changed; a blank password leaves the password alone. Extension field values * go under `extensions` as ValidatedExtensionValues. * - * @param ActionInput $input any of the fields a user is created with + * @param array $input any of the fields a user is created with * * @throws Throwable */ diff --git a/app/Data/AllocationRange.php b/app/Data/AllocationRange.php index a1ebd4214..a2275de06 100644 --- a/app/Data/AllocationRange.php +++ b/app/Data/AllocationRange.php @@ -13,10 +13,6 @@ final readonly class AllocationRange public int $end, ) {} - /** - * @param JsonInputValue $start - * @param JsonInputValue $end - */ public static function fromConfig(mixed $start, mixed $end): ?self { if (! $start || ! $end) { @@ -29,7 +25,6 @@ final readonly class AllocationRange ); } - /** @param JsonInputValue $value */ private static function integerLike(mixed $value, string $name): int { if (is_int($value)) { diff --git a/app/Data/EggCatalogEntry.php b/app/Data/EggCatalogEntry.php index 5b98f8828..b79568452 100644 --- a/app/Data/EggCatalogEntry.php +++ b/app/Data/EggCatalogEntry.php @@ -45,7 +45,6 @@ final readonly class EggCatalogEntry return $entries; } - /** @param JsonInputValue $value */ public static function fromValue(mixed $value): ?self { if (! is_array($value) || ! is_string($value['id'] ?? null) || ! is_string($value['name'] ?? null) diff --git a/app/Data/LoginResult.php b/app/Data/LoginResult.php index 64e571693..8cd55d9b9 100644 --- a/app/Data/LoginResult.php +++ b/app/Data/LoginResult.php @@ -32,7 +32,7 @@ final readonly class LoginResult /** * The `data` payload the panel's login screens expect from a JSON login endpoint. * - * @return array{complete: false, confirmation_token: string|null}|array{complete: true, intended: string, user: ApiPayload} + * @return array{complete: false, confirmation_token: string|null}|array{complete: true, intended: string, user: array} */ public function toResponseData(): array { diff --git a/app/Exceptions/ApiErrorResponse.php b/app/Exceptions/ApiErrorResponse.php index 403976224..a139dbcf4 100644 --- a/app/Exceptions/ApiErrorResponse.php +++ b/app/Exceptions/ApiErrorResponse.php @@ -194,7 +194,7 @@ final class ApiErrorResponse return is_int($min) && is_string($value) && mb_strlen($value) < $min ? 'min' : 'password'; } - /** @return list> */ + /** @return list> */ private static function cleanTrace(Throwable $exception): array { $cleaned = []; diff --git a/app/Exceptions/Service/Allocation/InvalidPortMappingException.php b/app/Exceptions/Service/Allocation/InvalidPortMappingException.php index 6aa41f174..ee6e29ef9 100644 --- a/app/Exceptions/Service/Allocation/InvalidPortMappingException.php +++ b/app/Exceptions/Service/Allocation/InvalidPortMappingException.php @@ -8,7 +8,7 @@ use Pterodactyl\Exceptions\DisplayException; class InvalidPortMappingException extends DisplayException { - /** @param ApiScalar $port */ + /** @param bool|float|int|string|null $port */ public function __construct(mixed $port) { parent::__construct(trans('exceptions.allocations.invalid_mapping', ['port' => $port])); diff --git a/app/Extensions/Backups/BackupManager.php b/app/Extensions/Backups/BackupManager.php index b73d9b8c3..2bddd5f41 100644 --- a/app/Extensions/Backups/BackupManager.php +++ b/app/Extensions/Backups/BackupManager.php @@ -13,7 +13,6 @@ use InvalidArgumentException; use League\Flysystem\FilesystemAdapter; use League\Flysystem\InMemory\InMemoryFilesystemAdapter; use Pterodactyl\Extensions\Filesystem\S3Filesystem; -use Pterodactyl\Support\JsonValueGuard; class BackupManager { @@ -173,7 +172,6 @@ class BackupManager protected function getConfig(string $name): array { $config = $this->config->get("backups.disks.$name") ?: []; - JsonValueGuard::assertValue($config); if (! is_array($config)) { return []; } diff --git a/app/Extensions/Filesystem/S3Filesystem.php b/app/Extensions/Filesystem/S3Filesystem.php index b6a630de6..5d67ea303 100644 --- a/app/Extensions/Filesystem/S3Filesystem.php +++ b/app/Extensions/Filesystem/S3Filesystem.php @@ -10,7 +10,7 @@ use League\Flysystem\AwsS3V3\AwsS3V3Adapter; class S3Filesystem extends AwsS3V3Adapter { /** - * @param array $options + * @param array $options */ public function __construct( private readonly S3ClientInterface $client, diff --git a/app/Extensions/League/Fractal/Serializers/PterodactylSerializer.php b/app/Extensions/League/Fractal/Serializers/PterodactylSerializer.php index 70aaacd3a..52ef4b4c5 100644 --- a/app/Extensions/League/Fractal/Serializers/PterodactylSerializer.php +++ b/app/Extensions/League/Fractal/Serializers/PterodactylSerializer.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Pterodactyl\Extensions\League\Fractal\Serializers; +use Illuminate\Support\Arr; use League\Fractal\Serializer\ArraySerializer; class PterodactylSerializer extends ArraySerializer @@ -11,8 +12,8 @@ class PterodactylSerializer extends ArraySerializer /** * Serialize an item. * - * @param ApiPayload9 $data - * @return array{object: string|null, attributes: ApiPayload9} + * @param array $data + * @return array{object: string|null, attributes: array} */ public function item(?string $resourceKey, array $data): array { @@ -25,8 +26,8 @@ class PterodactylSerializer extends ArraySerializer /** * Serialize a collection. * - * @param list $data - * @return array{object: string, data: list} + * @param list> $data + * @return array{object: string, data: list}>} */ public function collection(?string $resourceKey, array $data): array { @@ -57,9 +58,9 @@ class PterodactylSerializer extends ArraySerializer /** * Merge the included resources with the parent resource being serialized. * - * @param FractalTransformedPayload $transformedData - * @param ApiPayload9 $includedData - * @return FractalTransformedPayload + * @param array $transformedData + * @param array $includedData + * @return array */ public function mergeIncludes(array $transformedData, array $includedData): array { @@ -67,7 +68,7 @@ class PterodactylSerializer extends ArraySerializer return $transformedData; } - $relationships = $transformedData['relationships'] ?? []; + $relationships = Arr::array($transformedData, 'relationships', []); foreach ($includedData as $key => $datum) { $relationships[$key] = $datum; } diff --git a/app/Extensions/Scribe/Attributes/ResponseFromResource.php b/app/Extensions/Scribe/Attributes/ResponseFromResource.php index e2f16ef3b..e15108fbd 100644 --- a/app/Extensions/Scribe/Attributes/ResponseFromResource.php +++ b/app/Extensions/Scribe/Attributes/ResponseFromResource.php @@ -20,10 +20,10 @@ class ResponseFromResource extends ResponseFromApiResource * @param list $with Relationships eager loaded onto the example model. * @param string|null $resourceKey The `object` of the rendered items; null renders null. * @param int|null $paginate Renders a list paginated by this many per page. - * @param ApiPayload $meta Example values merged into the response envelope's - * top-level meta key, mirroring the controller's - * withMeta() output that rendering the resource alone - * cannot reproduce. + * @param array $meta Example values merged into the response envelope's + * top-level meta key, mirroring the controller's + * withMeta() output that rendering the resource alone + * cannot reproduce. * @param string[] $include Includes to render so the documented response carries * the relationships the endpoint can embed. * @param string[] $withCount Relationship counts to load on the example model, diff --git a/app/Extensions/Scribe/Attributes/ResponseFromTransformer.php b/app/Extensions/Scribe/Attributes/ResponseFromTransformer.php index d33d03689..88e4b89d9 100644 --- a/app/Extensions/Scribe/Attributes/ResponseFromTransformer.php +++ b/app/Extensions/Scribe/Attributes/ResponseFromTransformer.php @@ -14,10 +14,10 @@ class ResponseFromTransformer extends BaseResponseFromTransformer * @param list $factoryStates Factory states applied to the example model. * @param list $with Relationships eager loaded onto the example model. * @param array{}|array{class-string, int} $paginate Format: [adapter, numberPerPage]. - * @param ApiPayload $meta Example values merged into the response envelope's - * top-level meta key, mirroring the controller's - * Fractal ->addMeta() output that transformer - * execution alone cannot reproduce. + * @param array $meta Example values merged into the response envelope's + * top-level meta key, mirroring the controller's + * Fractal ->addMeta() output that transformer + * execution alone cannot reproduce. * @param string[] $include Fractal includes to execute so the documented response * carries the relationships the endpoint can embed. * @param string[] $withCount Relationship counts to load on the example model, diff --git a/app/Extensions/Scribe/Strategies/UsePterodactylResponseAttributes.php b/app/Extensions/Scribe/Strategies/UsePterodactylResponseAttributes.php index 342aef4ac..e22e493ad 100644 --- a/app/Extensions/Scribe/Strategies/UsePterodactylResponseAttributes.php +++ b/app/Extensions/Scribe/Strategies/UsePterodactylResponseAttributes.php @@ -218,7 +218,7 @@ class UsePterodactylResponseAttributes extends UseResponseAttributes * Merges an attribute's example meta into the rendered envelope's top-level meta, after * any pagination, mirroring what the controller adds and rendering alone cannot. * - * @param ApiPayload $meta + * @param array $meta */ private function withExampleMeta(string $content, array $meta): string|false { diff --git a/app/Extensions/Spatie/Fractalistic/Fractal.php b/app/Extensions/Spatie/Fractalistic/Fractal.php index 6d4bc4b8c..f062398c1 100644 --- a/app/Extensions/Spatie/Fractalistic/Fractal.php +++ b/app/Extensions/Spatie/Fractalistic/Fractal.php @@ -22,7 +22,7 @@ class Fractal extends SpatieFractal /** * Serialize a non-null API resource. * - * @return ApiPayload + * @return array * * @throws InvalidTransformation * @throws NoTransformerSpecified diff --git a/app/Http/Controllers/Api/Admin/ActivityController.php b/app/Http/Controllers/Api/Admin/ActivityController.php index cea7c9447..761419d7a 100644 --- a/app/Http/Controllers/Api/Admin/ActivityController.php +++ b/app/Http/Controllers/Api/Admin/ActivityController.php @@ -31,7 +31,7 @@ class ActivityController extends AdminApiController /** * List activity. * - * @return ApiPayload + * @return array */ #[Endpoint('List activity', 'Returns a paginated list of administrative activity. Only events in the "admin" namespace are returned; customer activity against a server or account is excluded.')] #[QueryParam('filter[event]', 'string', 'Filter activity by event name.', required: false, example: 'admin:server.build')] diff --git a/app/Http/Controllers/Api/Admin/ApiKeys/ApiKeyController.php b/app/Http/Controllers/Api/Admin/ApiKeys/ApiKeyController.php index baf21c5ab..faf096711 100644 --- a/app/Http/Controllers/Api/Admin/ApiKeys/ApiKeyController.php +++ b/app/Http/Controllers/Api/Admin/ApiKeys/ApiKeyController.php @@ -36,7 +36,7 @@ class ApiKeyController extends AdminApiController /** * List API keys. * - * @return ApiPayload + * @return array */ #[Endpoint('List API keys', 'Returns a paginated list of application API keys.')] #[QueryParam('filter[memo]', 'string', 'Filter keys by memo.', required: false, example: 'Automation')] @@ -83,7 +83,7 @@ class ApiKeyController extends AdminApiController /** * Show API key. * - * @return ApiPayload + * @return array */ #[Endpoint('Get API key', 'Returns a single application API key by identifier without exposing its token.')] #[ResponseFromTransformer(ApiKeyTransformer::class, ApiKey::class, description: 'API key returned.', resourceKey: 'api_key')] @@ -103,7 +103,7 @@ class ApiKeyController extends AdminApiController /** * Update API key. * - * @return ApiPayload + * @return array */ #[Endpoint('Update API key', 'Updates an application API key memo and resource permissions without regenerating the token.')] #[ResponseFromTransformer(ApiKeyTransformer::class, ApiKey::class, description: 'API key updated.', resourceKey: 'api_key')] diff --git a/app/Http/Controllers/Api/Admin/DatabaseHosts/DatabaseHostController.php b/app/Http/Controllers/Api/Admin/DatabaseHosts/DatabaseHostController.php index ad9176049..75c9e089c 100644 --- a/app/Http/Controllers/Api/Admin/DatabaseHosts/DatabaseHostController.php +++ b/app/Http/Controllers/Api/Admin/DatabaseHosts/DatabaseHostController.php @@ -85,7 +85,7 @@ class DatabaseHostController extends AdminApiController /** * List database hosts. * - * @return ApiPayload + * @return array */ #[Endpoint('List database hosts', 'Returns a paginated list of database hosts.')] #[QueryParam('page', 'integer', 'Page number to retrieve.', required: false, example: 1)] @@ -114,7 +114,7 @@ class DatabaseHostController extends AdminApiController /** * Show database host. * - * @return ApiPayload + * @return array */ #[Endpoint('Get database host', 'Returns a single database host by ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports node and databases.', required: false, example: 'node')] @@ -132,7 +132,7 @@ class DatabaseHostController extends AdminApiController /** * List databases associated with a database host. * - * @return ApiPayload + * @return array */ #[Endpoint('List database host databases', 'Returns a paginated list of server databases assigned to a database host.')] #[QueryParam('page', 'integer', 'Page number to retrieve.', required: false, example: 1)] @@ -199,7 +199,7 @@ class DatabaseHostController extends AdminApiController /** * Update database host. * - * @return ApiPayload + * @return array */ #[Endpoint('Update database host', 'Updates a database host after validating that the panel can connect to the supplied host details.')] #[ResponseFromTransformer(DatabaseHostTransformer::class, DatabaseHost::class, description: 'Database host updated.', resourceKey: 'database_host')] diff --git a/app/Http/Controllers/Api/Admin/Eggs/EggController.php b/app/Http/Controllers/Api/Admin/Eggs/EggController.php index 4663e42a3..aef023d36 100644 --- a/app/Http/Controllers/Api/Admin/Eggs/EggController.php +++ b/app/Http/Controllers/Api/Admin/Eggs/EggController.php @@ -46,7 +46,7 @@ class EggController extends AdminApiController /** * List eggs. * - * @return ApiPayload + * @return array */ #[Endpoint('List eggs', 'Returns a paginated list of egg definitions.')] #[QueryParam('filter[name]', 'string', 'Filter eggs by name.', required: false, example: 'Paper')] @@ -70,7 +70,7 @@ class EggController extends AdminApiController /** * Show egg. * - * @return ApiPayload + * @return array */ #[Endpoint('Get egg', 'Returns a single egg definition by ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include: variables, tags, servers.', required: false, example: 'variables,tags', enum: ['variables', 'tags', 'servers', 'variables,tags', 'variables,servers', 'tags,servers', 'variables,tags,servers'])] @@ -108,7 +108,7 @@ class EggController extends AdminApiController /** * Update egg. * - * @return ApiPayload + * @return array */ #[Endpoint('Update egg', 'Updates an egg definition.')] #[ResponseFromTransformer(EggTransformer::class, Egg::class, description: 'Egg updated.', resourceKey: 'egg')] diff --git a/app/Http/Controllers/Api/Admin/Eggs/EggScriptController.php b/app/Http/Controllers/Api/Admin/Eggs/EggScriptController.php index 6eeea6df7..779546417 100644 --- a/app/Http/Controllers/Api/Admin/Eggs/EggScriptController.php +++ b/app/Http/Controllers/Api/Admin/Eggs/EggScriptController.php @@ -35,7 +35,7 @@ class EggScriptController extends AdminApiController /** * Show egg install script. * - * @return ApiPayload + * @return array */ #[Endpoint('Get egg install script', 'Returns an egg with its install script block.')] #[ResponseFromTransformer(EggTransformer::class, Egg::class, description: 'Egg install script returned.', resourceKey: 'egg')] @@ -50,7 +50,7 @@ class EggScriptController extends AdminApiController /** * Update egg install script. * - * @return ApiPayload + * @return array */ #[Endpoint('Update egg install script', 'Updates the install script configuration for an egg.')] #[ResponseFromTransformer(EggTransformer::class, Egg::class, description: 'Egg install script updated.', resourceKey: 'egg')] diff --git a/app/Http/Controllers/Api/Admin/Eggs/EggVariableController.php b/app/Http/Controllers/Api/Admin/Eggs/EggVariableController.php index e2cb49955..89180678b 100644 --- a/app/Http/Controllers/Api/Admin/Eggs/EggVariableController.php +++ b/app/Http/Controllers/Api/Admin/Eggs/EggVariableController.php @@ -34,7 +34,7 @@ class EggVariableController extends AdminApiController /** * List egg variables. * - * @return ApiPayload + * @return array */ #[Endpoint('List egg variables', 'Returns variables for an egg in display order.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Unknown includes are ignored.', required: false, example: 'egg')] @@ -70,7 +70,7 @@ class EggVariableController extends AdminApiController /** * Update egg variable. * - * @return ApiPayload + * @return array */ #[Endpoint('Update egg variable', 'Updates a startup variable for an egg.')] #[ResponseFromTransformer(EggVariableTransformer::class, EggVariable::class, description: 'Egg variable updated.', resourceKey: 'egg_variable')] diff --git a/app/Http/Controllers/Api/Admin/Eggs/ReorderVariablesController.php b/app/Http/Controllers/Api/Admin/Eggs/ReorderVariablesController.php index 98f776fe3..c42492b10 100644 --- a/app/Http/Controllers/Api/Admin/Eggs/ReorderVariablesController.php +++ b/app/Http/Controllers/Api/Admin/Eggs/ReorderVariablesController.php @@ -24,7 +24,7 @@ class ReorderVariablesController extends AdminApiController /** * Reorder egg variables. * - * @return ApiPayload + * @return array */ #[Endpoint('Reorder egg variables', 'Updates the display order for variables on an egg.')] #[ResponseFromTransformer(EggVariableTransformer::class, EggVariable::class, description: 'Egg variables reordered.', collection: true, resourceKey: 'egg_variable')] diff --git a/app/Http/Controllers/Api/Admin/Eggs/UpdateImportEggController.php b/app/Http/Controllers/Api/Admin/Eggs/UpdateImportEggController.php index 26153b091..d15c27816 100644 --- a/app/Http/Controllers/Api/Admin/Eggs/UpdateImportEggController.php +++ b/app/Http/Controllers/Api/Admin/Eggs/UpdateImportEggController.php @@ -23,7 +23,7 @@ class UpdateImportEggController extends AdminApiController /** * Import updates into existing egg. * - * @return ApiPayload + * @return array */ #[Endpoint('Update egg from import', 'Updates an existing egg from an uploaded egg share JSON file.')] #[ResponseFromTransformer(EggTransformer::class, Egg::class, description: 'Egg updated from import.', resourceKey: 'egg')] diff --git a/app/Http/Controllers/Api/Admin/Extensions/ExtensionController.php b/app/Http/Controllers/Api/Admin/Extensions/ExtensionController.php index cd4ef6b07..b23ba110c 100644 --- a/app/Http/Controllers/Api/Admin/Extensions/ExtensionController.php +++ b/app/Http/Controllers/Api/Admin/Extensions/ExtensionController.php @@ -281,7 +281,7 @@ class ExtensionController extends AdminApiController } /** - * @return ApiPayload + * @return array */ private function serializeInstalled(string $identifier, ExtensionRepository $extensions, ExtensionAssetPublisher $assets): array { @@ -294,7 +294,7 @@ class ExtensionController extends AdminApiController } /** - * @return ApiPayload + * @return array */ private function serializeManifest(ExtensionManifest $manifest, ?Extension $record, ExtensionAssetPublisher $assets): array { diff --git a/app/Http/Controllers/Api/Admin/Locations/EligibleNodesController.php b/app/Http/Controllers/Api/Admin/Locations/EligibleNodesController.php index 3b7d78fab..3063e550e 100644 --- a/app/Http/Controllers/Api/Admin/Locations/EligibleNodesController.php +++ b/app/Http/Controllers/Api/Admin/Locations/EligibleNodesController.php @@ -22,7 +22,7 @@ class EligibleNodesController extends AdminApiController /** * List nodes eligible for location. * - * @return ApiPayload + * @return array */ #[Endpoint('List eligible location nodes', 'Returns nodes assigned to a location that can be selected for location-scoped workflows.')] #[ResponseFromTransformer(NodeTransformer::class, Node::class, description: 'Eligible nodes returned.', collection: true, factoryStates: ['withLocation'], resourceKey: 'node')] diff --git a/app/Http/Controllers/Api/Admin/Locations/LocationController.php b/app/Http/Controllers/Api/Admin/Locations/LocationController.php index b01ecc5d1..d1fba49a7 100644 --- a/app/Http/Controllers/Api/Admin/Locations/LocationController.php +++ b/app/Http/Controllers/Api/Admin/Locations/LocationController.php @@ -37,7 +37,7 @@ class LocationController extends AdminApiController /** * List locations. * - * @return ApiPayload + * @return array */ #[Endpoint('List locations', 'Returns a paginated list of locations.')] #[QueryParam('filter[short]', 'string', 'Filter locations by short identifier.', required: false, example: 'us-east')] @@ -64,7 +64,7 @@ class LocationController extends AdminApiController /** * Show location. * - * @return ApiPayload + * @return array */ #[Endpoint('Get location', 'Returns a single location by ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "nodes" and "servers".', required: false, example: 'nodes', enum: ['nodes', 'servers', 'nodes,servers'])] @@ -109,7 +109,7 @@ class LocationController extends AdminApiController /** * Update location. * - * @return ApiPayload + * @return array */ #[Endpoint('Update location', 'Updates a location short identifier and description.')] #[ResponseFromTransformer(LocationTransformer::class, Location::class, description: 'Location updated.', resourceKey: 'location')] diff --git a/app/Http/Controllers/Api/Admin/Mounts/AttachEggsController.php b/app/Http/Controllers/Api/Admin/Mounts/AttachEggsController.php index 67d0512b6..3bb86b8d1 100644 --- a/app/Http/Controllers/Api/Admin/Mounts/AttachEggsController.php +++ b/app/Http/Controllers/Api/Admin/Mounts/AttachEggsController.php @@ -24,7 +24,7 @@ class AttachEggsController extends AdminApiController /** * Attach eggs to mount. * - * @return ApiPayload + * @return array */ #[Endpoint('Attach eggs to mount', 'Attaches one or more eggs to a mount definition without removing existing egg attachments.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "eggs", "nodes", and "servers".', required: false, example: 'eggs,nodes', enum: ['eggs', 'nodes', 'servers', 'eggs,nodes', 'eggs,nodes,servers'])] diff --git a/app/Http/Controllers/Api/Admin/Mounts/AttachNodesController.php b/app/Http/Controllers/Api/Admin/Mounts/AttachNodesController.php index 48524a1cc..2d5963b71 100644 --- a/app/Http/Controllers/Api/Admin/Mounts/AttachNodesController.php +++ b/app/Http/Controllers/Api/Admin/Mounts/AttachNodesController.php @@ -24,7 +24,7 @@ class AttachNodesController extends AdminApiController /** * Attach nodes to mount. * - * @return ApiPayload + * @return array */ #[Endpoint('Attach nodes to mount', 'Attaches one or more nodes to a mount definition without removing existing node attachments.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "eggs", "nodes", and "servers".', required: false, example: 'eggs,nodes', enum: ['eggs', 'nodes', 'servers', 'eggs,nodes', 'eggs,nodes,servers'])] diff --git a/app/Http/Controllers/Api/Admin/Mounts/MountController.php b/app/Http/Controllers/Api/Admin/Mounts/MountController.php index ce214a4e7..d29e34205 100644 --- a/app/Http/Controllers/Api/Admin/Mounts/MountController.php +++ b/app/Http/Controllers/Api/Admin/Mounts/MountController.php @@ -53,7 +53,7 @@ class MountController extends AdminApiController /** * List mounts. * - * @return ApiPayload + * @return array */ #[Endpoint('List mounts', 'Returns a paginated list of mount definitions.')] #[QueryParam('filter[name]', 'string', 'Filter mounts by name.', required: false, example: 'Shared Mods')] @@ -77,7 +77,7 @@ class MountController extends AdminApiController /** * Show mount. * - * @return ApiPayload + * @return array */ #[Endpoint('Get mount', 'Returns a single mount definition by ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "eggs", "nodes", and "servers".', required: false, example: 'eggs,nodes', enum: ['eggs', 'nodes', 'servers', 'eggs,nodes', 'eggs,nodes,servers'])] @@ -119,7 +119,7 @@ class MountController extends AdminApiController /** * Update mount. * - * @return ApiPayload + * @return array */ #[Endpoint('Update mount', 'Updates an existing mount definition.')] #[ResponseFromTransformer(MountTransformer::class, Mount::class, description: 'Mount updated.', resourceKey: 'mount')] diff --git a/app/Http/Controllers/Api/Admin/Nodes/AllocationController.php b/app/Http/Controllers/Api/Admin/Nodes/AllocationController.php index 4936b5754..5340cbef2 100644 --- a/app/Http/Controllers/Api/Admin/Nodes/AllocationController.php +++ b/app/Http/Controllers/Api/Admin/Nodes/AllocationController.php @@ -47,7 +47,7 @@ class AllocationController extends AdminApiController /** * List allocations. * - * @return ApiPayload + * @return array */ #[Endpoint('List node allocations', 'Returns a paginated list of allocations for a node.')] #[QueryParam('filter[ip]', 'string', 'Filter allocations by exact IP address.', required: false, example: '192.168.1.1')] @@ -123,7 +123,7 @@ class AllocationController extends AdminApiController /** * Update allocation. * - * @return ApiPayload + * @return array */ #[Endpoint('Update node allocation', 'Updates the alias for a single allocation on a node.')] #[ResponseFromTransformer(AllocationTransformer::class, Allocation::class, description: 'Allocation updated.', resourceKey: 'allocation')] diff --git a/app/Http/Controllers/Api/Admin/Nodes/AvailableAllocationsController.php b/app/Http/Controllers/Api/Admin/Nodes/AvailableAllocationsController.php index 84ce59871..69be6f381 100644 --- a/app/Http/Controllers/Api/Admin/Nodes/AvailableAllocationsController.php +++ b/app/Http/Controllers/Api/Admin/Nodes/AvailableAllocationsController.php @@ -26,7 +26,7 @@ class AvailableAllocationsController extends AdminApiController /** * Return available allocations for node. * - * @return ApiPayload + * @return array */ #[Endpoint('List available node allocations', 'Returns unassigned allocations for a node.')] #[QueryParam('filter[ip]', 'string', 'Filter allocations by exact IP address.', example: '192.168.1.1')] diff --git a/app/Http/Controllers/Api/Admin/Nodes/NodeController.php b/app/Http/Controllers/Api/Admin/Nodes/NodeController.php index b0f54ad1b..541ced653 100644 --- a/app/Http/Controllers/Api/Admin/Nodes/NodeController.php +++ b/app/Http/Controllers/Api/Admin/Nodes/NodeController.php @@ -47,7 +47,7 @@ class NodeController extends AdminApiController /** * List nodes. * - * @return ApiPayload + * @return array */ #[Endpoint('List nodes', 'Returns a paginated list of Wings nodes.')] #[QueryParam('filter[uuid]', 'string', 'Filter nodes by UUID.', required: false, example: '1b19cf3f-2f89-4f88-a81e-321e7fe326bc')] @@ -73,7 +73,7 @@ class NodeController extends AdminApiController /** * Show node. * - * @return ApiPayload + * @return array */ #[Endpoint('Get node', 'Returns a single Wings node by ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "allocations", "location", and "servers".', required: false, example: 'location', enum: ['allocations', 'location', 'servers', 'allocations,location', 'location,servers'])] @@ -115,7 +115,7 @@ class NodeController extends AdminApiController /** * Update node. * - * @return ApiPayload + * @return array */ #[Endpoint('Update node', 'Updates a Wings node and optionally rotates its daemon secret.')] #[BodyParam('reset_secret', 'boolean', 'Whether to rotate the daemon secret.', required: false, example: false)] diff --git a/app/Http/Controllers/Api/Admin/Servers/BuildController.php b/app/Http/Controllers/Api/Admin/Servers/BuildController.php index fec12c030..ee3142baf 100644 --- a/app/Http/Controllers/Api/Admin/Servers/BuildController.php +++ b/app/Http/Controllers/Api/Admin/Servers/BuildController.php @@ -23,7 +23,7 @@ class BuildController extends AdminApiController /** * Update server build configuration. * - * @return ApiPayload + * @return array */ #[Endpoint('Update server build', 'Updates server limits, primary allocation, and feature limits.')] #[ResponseFromTransformer(ServerTransformer::class, Server::class, description: 'Server build updated.', factoryStates: ['withRelationships'], resourceKey: 'server')] diff --git a/app/Http/Controllers/Api/Admin/Servers/DatabaseController.php b/app/Http/Controllers/Api/Admin/Servers/DatabaseController.php index 6c5c9c970..6325c9975 100644 --- a/app/Http/Controllers/Api/Admin/Servers/DatabaseController.php +++ b/app/Http/Controllers/Api/Admin/Servers/DatabaseController.php @@ -43,7 +43,7 @@ class DatabaseController extends AdminApiController /** * List server databases. * - * @return ApiPayload + * @return array */ #[Endpoint('List server databases', 'Returns all databases assigned to a server.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "password".', required: false, example: 'password', enum: ['password'])] @@ -61,7 +61,7 @@ class DatabaseController extends AdminApiController /** * Show server database. * - * @return ApiPayload + * @return array */ #[Endpoint('Get server database', 'Returns a single database assigned to a server.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "password".', required: false, example: 'password', enum: ['password'])] diff --git a/app/Http/Controllers/Api/Admin/Servers/DetailsController.php b/app/Http/Controllers/Api/Admin/Servers/DetailsController.php index 40b5dcae5..410837d72 100644 --- a/app/Http/Controllers/Api/Admin/Servers/DetailsController.php +++ b/app/Http/Controllers/Api/Admin/Servers/DetailsController.php @@ -24,7 +24,7 @@ class DetailsController extends AdminApiController /** * Update server details. * - * @return ApiPayload + * @return array */ #[Endpoint('Update server details', 'Updates a server name, owner, description, and external identifier.')] #[ResponseFromTransformer(ServerTransformer::class, Server::class, description: 'Server updated.', factoryStates: ['withRelationships'], resourceKey: 'server')] diff --git a/app/Http/Controllers/Api/Admin/Servers/ExternalController.php b/app/Http/Controllers/Api/Admin/Servers/ExternalController.php index cd65a1c35..b8ee5520e 100644 --- a/app/Http/Controllers/Api/Admin/Servers/ExternalController.php +++ b/app/Http/Controllers/Api/Admin/Servers/ExternalController.php @@ -21,7 +21,7 @@ class ExternalController extends AdminApiController /** * Show server by external identifier. * - * @return ApiPayload + * @return array */ #[Endpoint('Get server by external ID', 'Returns a single server by external identifier.')] #[ResponseFromTransformer(ServerTransformer::class, Server::class, description: 'Server returned.', factoryStates: ['withRelationships'], resourceKey: 'server')] diff --git a/app/Http/Controllers/Api/Admin/Servers/RotateDatabasePasswordController.php b/app/Http/Controllers/Api/Admin/Servers/RotateDatabasePasswordController.php index c0bb06303..c80e237c8 100644 --- a/app/Http/Controllers/Api/Admin/Servers/RotateDatabasePasswordController.php +++ b/app/Http/Controllers/Api/Admin/Servers/RotateDatabasePasswordController.php @@ -25,7 +25,7 @@ class RotateDatabasePasswordController extends AdminApiController /** * Rotate server database password. * - * @return ApiPayload + * @return array */ #[Endpoint('Rotate server database password', 'Rotates the password for a database assigned to a server.')] #[ResponseFromTransformer(ServerDatabaseTransformer::class, Database::class, description: 'Database password rotated.', resourceKey: 'server_database', include: ['password'])] diff --git a/app/Http/Controllers/Api/Admin/Servers/ServerBackupController.php b/app/Http/Controllers/Api/Admin/Servers/ServerBackupController.php index a0a00d205..bf0e20928 100644 --- a/app/Http/Controllers/Api/Admin/Servers/ServerBackupController.php +++ b/app/Http/Controllers/Api/Admin/Servers/ServerBackupController.php @@ -25,7 +25,7 @@ class ServerBackupController extends AdminApiController /** * List server backups. * - * @return ApiPayload + * @return array */ #[Endpoint('List server backups', 'Returns a paginated list of backups assigned to a server.')] #[QueryParam('filter[uuid]', 'string', 'Filter backups by UUID.', example: '1b19cf3f-2f89-4f88-a81e-321e7fe326bc')] diff --git a/app/Http/Controllers/Api/Admin/Servers/ServerController.php b/app/Http/Controllers/Api/Admin/Servers/ServerController.php index 15bb6a9b1..9a70f9b77 100644 --- a/app/Http/Controllers/Api/Admin/Servers/ServerController.php +++ b/app/Http/Controllers/Api/Admin/Servers/ServerController.php @@ -36,7 +36,7 @@ class ServerController extends AdminApiController /** * List servers. * - * @return ApiPayload + * @return array */ #[Endpoint('List servers', 'Returns a paginated list of servers.')] #[QueryParam('filter[*]', 'string', 'Search servers by UUID, name, owner, node, allocation, or external identifier.', required: false, example: 'Survival')] @@ -76,7 +76,7 @@ class ServerController extends AdminApiController /** * Show server. * - * @return ApiPayload + * @return array */ #[Endpoint('Get server', 'Returns a single server by admin identifier.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports allocation, allocations, user, subusers, egg, variables, location, node, and databases.', required: false, example: 'allocations,user,node,egg,variables')] diff --git a/app/Http/Controllers/Api/Admin/Servers/StartupController.php b/app/Http/Controllers/Api/Admin/Servers/StartupController.php index 0672c2b47..c66d138d6 100644 --- a/app/Http/Controllers/Api/Admin/Servers/StartupController.php +++ b/app/Http/Controllers/Api/Admin/Servers/StartupController.php @@ -24,7 +24,7 @@ class StartupController extends AdminApiController /** * Update server startup configuration. * - * @return ApiPayload + * @return array */ #[Endpoint('Update server startup', 'Updates the egg, Docker image, startup command, environment, and install-script behavior.')] #[ResponseFromTransformer(ServerTransformer::class, Server::class, description: 'Server startup updated.', factoryStates: ['withRelationships'], resourceKey: 'server')] diff --git a/app/Http/Controllers/Api/Admin/Servers/ToggleBackupController.php b/app/Http/Controllers/Api/Admin/Servers/ToggleBackupController.php index 6891f8bb9..43f4bf7c4 100644 --- a/app/Http/Controllers/Api/Admin/Servers/ToggleBackupController.php +++ b/app/Http/Controllers/Api/Admin/Servers/ToggleBackupController.php @@ -25,7 +25,7 @@ class ToggleBackupController extends AdminApiController /** * Toggle backup lock state. * - * @return ApiPayload + * @return array */ #[Endpoint('Toggle server backup lock', 'Toggles whether a server backup is locked against deletion.')] #[ResponseFromTransformer(BackupTransformer::class, Backup::class, description: 'Server backup lock state toggled.', resourceKey: 'backup')] diff --git a/app/Http/Controllers/Api/Admin/Servers/TransferProgressController.php b/app/Http/Controllers/Api/Admin/Servers/TransferProgressController.php index 2558bf4bf..0e8f1c6c6 100644 --- a/app/Http/Controllers/Api/Admin/Servers/TransferProgressController.php +++ b/app/Http/Controllers/Api/Admin/Servers/TransferProgressController.php @@ -24,7 +24,7 @@ class TransferProgressController extends AdminApiController /** * Return server transfer progress. * - * @return ApiPayload|Response + * @return array|Response */ #[Endpoint('Get server transfer progress', 'Returns the active transfer for a server, or 204 when no transfer is in progress.')] #[ResponseFromTransformer(ServerTransferTransformer::class, ServerTransfer::class, description: 'Transfer progress returned.', resourceKey: 'server_transfer')] diff --git a/app/Http/Controllers/Api/Admin/Tags/TagController.php b/app/Http/Controllers/Api/Admin/Tags/TagController.php index b82084c47..efd69a80a 100644 --- a/app/Http/Controllers/Api/Admin/Tags/TagController.php +++ b/app/Http/Controllers/Api/Admin/Tags/TagController.php @@ -50,7 +50,7 @@ class TagController extends AdminApiController /** * List tags. * - * @return ApiPayload + * @return array */ #[Endpoint('List tags', 'Returns a paginated list of tags.')] #[QueryParam('filter[name]', 'string', 'Filter tags by name.', required: false, example: 'Minecraft')] @@ -75,7 +75,7 @@ class TagController extends AdminApiController /** * Show tag. * - * @return ApiPayload + * @return array */ #[Endpoint('Get tag', 'Returns a single tag by ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "eggs" and "nodes".', required: false, example: 'eggs', enum: ['eggs', 'nodes', 'eggs,nodes'])] @@ -117,7 +117,7 @@ class TagController extends AdminApiController * Update tag. * * - * @return ApiPayload + * @return array * * @throws DisplayException */ @@ -165,7 +165,7 @@ class TagController extends AdminApiController /** * Replace the full set of tags on an egg. * - * @return ApiPayload + * @return array */ #[Endpoint('Sync egg tags', 'Replaces the tags applied to an egg. Values may be tag IDs or new tag names.')] #[ResponseFromTransformer(TagTransformer::class, Tag::class, description: 'Tags applied to the egg.', collection: true, resourceKey: 'tag')] @@ -189,7 +189,7 @@ class TagController extends AdminApiController * reservations are managed separately by syncNodeDeploymentTags(), and syncing * one kind never disturbs the other. * - * @return ApiPayload + * @return array */ #[Endpoint('Sync node game tags', 'Replaces the games a node accepts. A node with no game tags accepts any egg.')] #[ResponseFromTransformer(TagTransformer::class, Tag::class, description: 'Games the node accepts.', collection: true, resourceKey: 'tag')] @@ -212,7 +212,7 @@ class TagController extends AdminApiController * Replace the reservations on a node (the 'deployment'-kind attachments). A * deploy only lands on this node when it declares exactly these tags. * - * @return ApiPayload + * @return array */ #[Endpoint('Sync node deployment tags', 'Replaces the reservations on a node. A deploy must declare exactly these tags to land here.')] #[ResponseFromTransformer(TagTransformer::class, Tag::class, description: 'Reservations on the node.', collection: true, resourceKey: 'tag')] diff --git a/app/Http/Controllers/Api/Admin/Users/ExternalController.php b/app/Http/Controllers/Api/Admin/Users/ExternalController.php index efbe906b5..683b3cf35 100644 --- a/app/Http/Controllers/Api/Admin/Users/ExternalController.php +++ b/app/Http/Controllers/Api/Admin/Users/ExternalController.php @@ -21,7 +21,7 @@ class ExternalController extends AdminApiController /** * Show user by external identifier. * - * @return ApiPayload + * @return array */ #[Endpoint('Get user by external ID', 'Returns a single panel user by external identifier.')] #[ResponseFromTransformer(UserTransformer::class, User::class, description: 'User returned.', resourceKey: 'user')] diff --git a/app/Http/Controllers/Api/Admin/Users/UserController.php b/app/Http/Controllers/Api/Admin/Users/UserController.php index 3c554dfb6..036ce9fce 100644 --- a/app/Http/Controllers/Api/Admin/Users/UserController.php +++ b/app/Http/Controllers/Api/Admin/Users/UserController.php @@ -50,7 +50,7 @@ class UserController extends AdminApiController /** * List users. * - * @return ApiPayload + * @return array */ #[Endpoint('List users', 'Returns a paginated list of panel users, sorted with root administrators first by default.')] #[QueryParam('page', 'integer', 'Page number to retrieve.', required: false, example: 1)] @@ -101,7 +101,7 @@ class UserController extends AdminApiController /** * Show user. * - * @return ApiPayload + * @return array */ #[Endpoint('Get user', 'Returns a single panel user by internal numeric ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports servers.', required: false, example: 'servers')] @@ -141,7 +141,7 @@ class UserController extends AdminApiController /** * Update user. * - * @return ApiPayload + * @return array */ #[Endpoint('Update user', 'Updates an existing panel user. Supplying a password changes the user password.')] #[ResponseFromTransformer(UserTransformer::class, User::class, description: 'User updated.', resourceKey: 'user')] diff --git a/app/Http/Controllers/Api/Application/Eggs/EggController.php b/app/Http/Controllers/Api/Application/Eggs/EggController.php index a224ce6a2..5ed4cc872 100644 --- a/app/Http/Controllers/Api/Application/Eggs/EggController.php +++ b/app/Http/Controllers/Api/Application/Eggs/EggController.php @@ -26,7 +26,7 @@ class EggController extends ApplicationApiController /** * Return all eggs that exist on the panel. * - * @return ApiPayload + * @return array */ #[Endpoint('List eggs', 'Returns a paginated list of server eggs available on the panel.')] #[QueryParam('per_page', 'integer', 'Number of eggs to return per page, up to 100.', required: false, example: 50)] @@ -53,7 +53,7 @@ class EggController extends ApplicationApiController /** * Return a single egg. * - * @return ApiPayload + * @return array */ #[Endpoint('Get egg', 'Returns a single egg by internal numeric ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "servers", "config", "script", "variables", and "tags" when the key can read those resources.', required: false, example: 'variables', enum: ['servers', 'config', 'script', 'variables', 'tags'])] diff --git a/app/Http/Controllers/Api/Application/Locations/LocationController.php b/app/Http/Controllers/Api/Application/Locations/LocationController.php index 7e28c4454..940de1d4e 100644 --- a/app/Http/Controllers/Api/Application/Locations/LocationController.php +++ b/app/Http/Controllers/Api/Application/Locations/LocationController.php @@ -46,7 +46,7 @@ class LocationController extends ApplicationApiController /** * Return all the locations currently registered on the Panel. * - * @return ApiPayload + * @return array */ #[Endpoint('List locations', 'Returns a paginated list of all locations registered on the panel.')] #[QueryParam('per_page', 'integer', 'Number of locations to return per page, up to 100.', required: false, example: 50)] @@ -70,7 +70,7 @@ class LocationController extends ApplicationApiController /** * Return a single location. * - * @return ApiPayload + * @return array */ #[Endpoint('Get location', 'Returns a single location by internal numeric ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "nodes" and "servers" when the key can read those resources.', required: false, example: 'nodes,servers', enum: ['nodes', 'servers', 'nodes,servers'])] @@ -106,7 +106,7 @@ class LocationController extends ApplicationApiController /** * Update a location on the Panel and return the updated record to the user. * - * @return ApiPayload + * @return array */ #[Endpoint('Update location', 'Updates an existing location by internal numeric ID.')] #[ResponseFromTransformer(LocationTransformer::class, Location::class, resourceKey: 'location')] diff --git a/app/Http/Controllers/Api/Application/Nodes/AllocationController.php b/app/Http/Controllers/Api/Application/Nodes/AllocationController.php index d92b2f6ed..1a3824b27 100644 --- a/app/Http/Controllers/Api/Application/Nodes/AllocationController.php +++ b/app/Http/Controllers/Api/Application/Nodes/AllocationController.php @@ -59,7 +59,7 @@ class AllocationController extends ApplicationApiController /** * Return all the allocations that exist for a given node. * - * @return ApiPayload + * @return array */ #[Endpoint('List node allocations', 'Returns a paginated list of allocations belonging to a node.')] #[QueryParam('per_page', 'integer', 'Number of allocations to return per page, up to 100.', required: false, example: 50)] diff --git a/app/Http/Controllers/Api/Application/Nodes/NodeController.php b/app/Http/Controllers/Api/Application/Nodes/NodeController.php index d160116a5..b743e3b47 100644 --- a/app/Http/Controllers/Api/Application/Nodes/NodeController.php +++ b/app/Http/Controllers/Api/Application/Nodes/NodeController.php @@ -56,7 +56,7 @@ class NodeController extends ApplicationApiController /** * Return all the nodes currently available on the Panel. * - * @return ApiPayload + * @return array */ #[Endpoint('List nodes', 'Returns a paginated list of Wings nodes registered on the panel.')] #[QueryParam('per_page', 'integer', 'Number of nodes to return per page, up to 100.', required: false, example: 50)] @@ -84,7 +84,7 @@ class NodeController extends ApplicationApiController /** * Return data for a single instance of a node. * - * @return ApiPayload + * @return array */ #[Endpoint('Get node', 'Returns a single Wings node by internal numeric ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "allocations", "location", and "servers" when the key can read those resources.', required: false, example: 'location,allocations', enum: ['allocations', 'location', 'servers', 'location,allocations'])] @@ -121,7 +121,7 @@ class NodeController extends ApplicationApiController * Update an existing node on the Panel. * * - * @return ApiPayload + * @return array * * @throws Throwable */ diff --git a/app/Http/Controllers/Api/Application/Nodes/NodeDeploymentController.php b/app/Http/Controllers/Api/Application/Nodes/NodeDeploymentController.php index 09dbbbd7a..e77c13291 100644 --- a/app/Http/Controllers/Api/Application/Nodes/NodeDeploymentController.php +++ b/app/Http/Controllers/Api/Application/Nodes/NodeDeploymentController.php @@ -38,7 +38,7 @@ class NodeDeploymentController extends ApplicationApiController * to this endpoint and get back a list of all Nodes satisfying the requirements. * * - * @return ApiPayload + * @return array * * @throws NoViableNodeException */ diff --git a/app/Http/Controllers/Api/Application/Servers/DatabaseController.php b/app/Http/Controllers/Api/Application/Servers/DatabaseController.php index 3e069895a..d98e9eee6 100644 --- a/app/Http/Controllers/Api/Application/Servers/DatabaseController.php +++ b/app/Http/Controllers/Api/Application/Servers/DatabaseController.php @@ -44,7 +44,7 @@ class DatabaseController extends ApplicationApiController * Return a listing of all databases currently available to a single * server. * - * @return ApiPayload + * @return array */ #[Endpoint('List server databases', 'Returns all databases attached to a server.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "password" and "host" when the key can read database hosts.', required: false, example: 'password,host', enum: ['password', 'host', 'password,host'])] @@ -59,7 +59,7 @@ class DatabaseController extends ApplicationApiController /** * Return a single server database. * - * @return ApiPayload + * @return array */ #[Endpoint('Get server database', 'Returns a single database attached to a server.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "password" and "host" when the key can read database hosts.', required: false, example: 'password,host', enum: ['password', 'host', 'password,host'])] diff --git a/app/Http/Controllers/Api/Application/Servers/ExternalServerController.php b/app/Http/Controllers/Api/Application/Servers/ExternalServerController.php index 0a2f22381..6b5a5d2df 100644 --- a/app/Http/Controllers/Api/Application/Servers/ExternalServerController.php +++ b/app/Http/Controllers/Api/Application/Servers/ExternalServerController.php @@ -21,7 +21,7 @@ class ExternalServerController extends ApplicationApiController /** * Retrieve a specific server from the database using its external ID. * - * @return ApiPayload + * @return array */ #[Endpoint('Get server by external ID', 'Returns a single server by its external identifier.')] #[ResponseFromTransformer(ServerTransformer::class, Server::class, factoryStates: ['withRelationships'], resourceKey: 'server')] diff --git a/app/Http/Controllers/Api/Application/Servers/ServerController.php b/app/Http/Controllers/Api/Application/Servers/ServerController.php index f69d8a4b6..b2f7bc353 100644 --- a/app/Http/Controllers/Api/Application/Servers/ServerController.php +++ b/app/Http/Controllers/Api/Application/Servers/ServerController.php @@ -49,7 +49,7 @@ class ServerController extends ApplicationApiController /** * Return all the servers that currently exist on the Panel. * - * @return ApiPayload + * @return array */ #[Endpoint('List servers', 'Returns a paginated list of servers visible to the application API key.')] #[QueryParam('per_page', 'integer', 'Number of servers to return per page, up to 100.', required: false, example: 50)] @@ -113,7 +113,7 @@ class ServerController extends ApplicationApiController /** * Show a single server transformed for the application API. * - * @return ApiPayload + * @return array */ #[Endpoint('Get server', 'Returns a single server by internal numeric ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "allocations", "user", "subusers", "egg", "variables", "location", "node", "databases", and "transfer" when the key can read those resources.', required: false, example: 'user,node,allocations')] diff --git a/app/Http/Controllers/Api/Application/Servers/ServerDetailsController.php b/app/Http/Controllers/Api/Application/Servers/ServerDetailsController.php index 8a4ae615a..716e283b4 100644 --- a/app/Http/Controllers/Api/Application/Servers/ServerDetailsController.php +++ b/app/Http/Controllers/Api/Application/Servers/ServerDetailsController.php @@ -38,7 +38,7 @@ class ServerDetailsController extends ApplicationApiController * Update the details for a specific server. * * - * @return ApiPayload + * @return array * * @throws DisplayException */ @@ -61,7 +61,7 @@ class ServerDetailsController extends ApplicationApiController * Update the build details for a specific server. * * - * @return ApiPayload + * @return array * * @throws DisplayException */ diff --git a/app/Http/Controllers/Api/Application/Servers/StartupController.php b/app/Http/Controllers/Api/Application/Servers/StartupController.php index ac65972f9..337a4129b 100644 --- a/app/Http/Controllers/Api/Application/Servers/StartupController.php +++ b/app/Http/Controllers/Api/Application/Servers/StartupController.php @@ -37,7 +37,7 @@ class StartupController extends ApplicationApiController * Update the startup and environment settings for a specific server. * * - * @return ApiPayload + * @return array * * @throws ValidationException * @throws DaemonConnectionException diff --git a/app/Http/Controllers/Api/Application/Tags/TagController.php b/app/Http/Controllers/Api/Application/Tags/TagController.php index 63f60c557..7dcec2c03 100644 --- a/app/Http/Controllers/Api/Application/Tags/TagController.php +++ b/app/Http/Controllers/Api/Application/Tags/TagController.php @@ -25,7 +25,7 @@ class TagController extends ApplicationApiController /** * Return all tags that exist on the panel. * - * @return ApiPayload + * @return array */ #[Endpoint('List tags', 'Returns a paginated list of the tags that group eggs.')] #[QueryParam('per_page', 'integer', 'Number of tags to return per page, up to 100.', required: false, example: 50)] @@ -49,7 +49,7 @@ class TagController extends ApplicationApiController /** * Return a single tag. * - * @return ApiPayload + * @return array */ #[Endpoint('Get tag', 'Returns a single tag by internal numeric ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "eggs" and "nodes" when the key can read those resources.', required: false, example: 'eggs', enum: ['eggs', 'nodes', 'eggs,nodes'])] diff --git a/app/Http/Controllers/Api/Application/Users/ExternalUserController.php b/app/Http/Controllers/Api/Application/Users/ExternalUserController.php index e22945be1..8a26d5cc8 100644 --- a/app/Http/Controllers/Api/Application/Users/ExternalUserController.php +++ b/app/Http/Controllers/Api/Application/Users/ExternalUserController.php @@ -21,7 +21,7 @@ class ExternalUserController extends ApplicationApiController /** * Retrieve a specific user from the database using their external ID. * - * @return ApiPayload + * @return array */ #[Endpoint('Get user by external ID', 'Returns a single panel user by its external identifier.')] #[ResponseFromTransformer(UserTransformer::class, User::class, resourceKey: 'user')] diff --git a/app/Http/Controllers/Api/Application/Users/UserController.php b/app/Http/Controllers/Api/Application/Users/UserController.php index afe1f27f6..3d5c7f918 100644 --- a/app/Http/Controllers/Api/Application/Users/UserController.php +++ b/app/Http/Controllers/Api/Application/Users/UserController.php @@ -37,7 +37,7 @@ class UserController extends ApplicationApiController * of a collection of users including any defined relations passed in * the request. * - * @return ApiPayload + * @return array */ #[Endpoint('List users', 'Returns a paginated list of panel users visible to the application API key.')] #[QueryParam('per_page', 'integer', 'Number of users to return per page, up to 100.', required: false, example: 50)] @@ -64,7 +64,7 @@ class UserController extends ApplicationApiController * Handle a request to view a single user. Includes any relations that * were defined in the request. * - * @return ApiPayload + * @return array */ #[Endpoint('Get user', 'Returns a single panel user by internal numeric ID.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "servers" when the key can read servers.', required: false, example: 'servers', enum: ['servers'])] @@ -77,7 +77,7 @@ class UserController extends ApplicationApiController } /** - * @return ApiPayload + * @return array * * @throws Throwable */ diff --git a/app/Http/Controllers/Api/Client/AccountController.php b/app/Http/Controllers/Api/Client/AccountController.php index 3a7c084ed..2253e0d0e 100644 --- a/app/Http/Controllers/Api/Client/AccountController.php +++ b/app/Http/Controllers/Api/Client/AccountController.php @@ -47,7 +47,7 @@ class AccountController extends ClientApiController ]; /** - * @return ApiPayload + * @return array */ #[Endpoint('Get account', 'Returns profile details for the authenticated user.')] #[ResponseFromTransformer(AccountTransformer::class, User::class, resourceKey: 'user')] diff --git a/app/Http/Controllers/Api/Client/ActivityLogController.php b/app/Http/Controllers/Api/Client/ActivityLogController.php index 587f0bb3e..f89d4a254 100644 --- a/app/Http/Controllers/Api/Client/ActivityLogController.php +++ b/app/Http/Controllers/Api/Client/ActivityLogController.php @@ -25,7 +25,7 @@ class ActivityLogController extends ClientApiController /** * Returns a paginated set of the user's activity logs. * - * @return ApiPayload + * @return array */ #[Endpoint('List account activity', 'Returns a paginated list of activity log entries for the authenticated user account.')] #[QueryParam('page', 'integer', 'Page number to retrieve.', required: false, example: 1)] diff --git a/app/Http/Controllers/Api/Client/ApiKeyController.php b/app/Http/Controllers/Api/Client/ApiKeyController.php index 1a7c27223..93db36697 100644 --- a/app/Http/Controllers/Api/Client/ApiKeyController.php +++ b/app/Http/Controllers/Api/Client/ApiKeyController.php @@ -36,7 +36,7 @@ class ApiKeyController extends ClientApiController /** * Returns all the API keys that exist for the given client. * - * @return ApiPayload + * @return array */ #[Endpoint('List account API keys', 'Returns all client API keys owned by the authenticated user.')] #[ResponseFromTransformer(ApiKeyTransformer::class, ApiKey::class, description: 'API keys returned.', collection: true, factoryStates: ['withAllowedIps'], resourceKey: 'api_key')] @@ -51,7 +51,7 @@ class ApiKeyController extends ClientApiController * Store a new API key for a user's account. * * - * @return ApiPayload + * @return array * * @throws DisplayException */ diff --git a/app/Http/Controllers/Api/Client/ClientController.php b/app/Http/Controllers/Api/Client/ClientController.php index cd4190d6d..86af90c6c 100644 --- a/app/Http/Controllers/Api/Client/ClientController.php +++ b/app/Http/Controllers/Api/Client/ClientController.php @@ -51,7 +51,7 @@ class ClientController extends ClientApiController * Return all the servers available to the client making the API * request, including servers the user has access to as a subuser. * - * @return ApiPayload + * @return array */ #[Endpoint('List client servers', 'Returns a paginated list of servers the authenticated user can access as an owner, subuser, or administrator.')] #[QueryParam('page', 'integer', 'Page number to return.', required: false, example: 1)] diff --git a/app/Http/Controllers/Api/Client/SSHKeyController.php b/app/Http/Controllers/Api/Client/SSHKeyController.php index 8c75e5083..c381c070e 100644 --- a/app/Http/Controllers/Api/Client/SSHKeyController.php +++ b/app/Http/Controllers/Api/Client/SSHKeyController.php @@ -27,7 +27,7 @@ class SSHKeyController extends ClientApiController * Returns all the SSH keys that have been configured for the logged-in * user account. * - * @return ApiPayload + * @return array */ #[Endpoint('List SSH keys', 'Returns all SSH public keys configured for the authenticated user.')] #[ResponseFromTransformer(UserSSHKeyTransformer::class, UserSSHKey::class, description: 'SSH keys returned.', collection: true, resourceKey: 'ssh_key')] @@ -41,7 +41,7 @@ class SSHKeyController extends ClientApiController /** * Stores a new SSH key for the authenticated user's account. * - * @return ApiPayload + * @return array */ #[Endpoint('Create SSH key', 'Adds an SSH public key to the authenticated user account.')] #[ResponseFromTransformer(UserSSHKeyTransformer::class, UserSSHKey::class, description: 'SSH key created.', resourceKey: 'ssh_key')] diff --git a/app/Http/Controllers/Api/Client/Servers/ActivityLogController.php b/app/Http/Controllers/Api/Client/Servers/ActivityLogController.php index c42a94439..5d636c4c5 100644 --- a/app/Http/Controllers/Api/Client/Servers/ActivityLogController.php +++ b/app/Http/Controllers/Api/Client/Servers/ActivityLogController.php @@ -29,7 +29,7 @@ class ActivityLogController extends ClientApiController /** * Returns the activity logs for a server. * - * @return ApiPayload + * @return array */ #[Endpoint('List server activity', 'Returns a paginated list of activity log entries for the server.')] #[QueryParam('page', 'integer', 'Page number to retrieve.', required: false, example: 1)] diff --git a/app/Http/Controllers/Api/Client/Servers/BackupController.php b/app/Http/Controllers/Api/Client/Servers/BackupController.php index 6d7c05d21..b8ab6bb73 100644 --- a/app/Http/Controllers/Api/Client/Servers/BackupController.php +++ b/app/Http/Controllers/Api/Client/Servers/BackupController.php @@ -61,7 +61,7 @@ class BackupController extends ClientApiController * result set. * * - * @return ApiPayload + * @return array */ #[Endpoint('List server backups', 'Returns a paginated list of backups for the server.')] #[QueryParam('page', 'integer', 'The page number to return.', required: false, example: 1)] @@ -81,7 +81,7 @@ class BackupController extends ClientApiController * Starts the backup process for a server. * * - * @return ApiPayload + * @return array * * @throws InvalidTransformation * @throws NoTransformerSpecified @@ -114,7 +114,7 @@ class BackupController extends ClientApiController * Toggles the lock status of a given backup for a server. * * - * @return ApiPayload + * @return array * * @throws Throwable */ @@ -133,7 +133,7 @@ class BackupController extends ClientApiController * Returns information about a single backup. * * - * @return ApiPayload + * @return array */ #[Endpoint('Get server backup', 'Returns information about one server backup.')] #[ResponseFromTransformer(BackupTransformer::class, Backup::class, description: 'Server backup returned.', resourceKey: 'backup')] diff --git a/app/Http/Controllers/Api/Client/Servers/DatabaseController.php b/app/Http/Controllers/Api/Client/Servers/DatabaseController.php index e3830f4b5..2d699c821 100644 --- a/app/Http/Controllers/Api/Client/Servers/DatabaseController.php +++ b/app/Http/Controllers/Api/Client/Servers/DatabaseController.php @@ -44,7 +44,7 @@ class DatabaseController extends ClientApiController /** * Return all the databases that belong to the given server. * - * @return ApiPayload + * @return array */ #[Endpoint('List server databases', 'Returns databases attached to a server visible to the authenticated user.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports "password" when the user can view database passwords.', required: false, example: 'password', enum: ['password'])] @@ -60,7 +60,7 @@ class DatabaseController extends ClientApiController * Create a new database for the given server and return it. * * - * @return ApiPayload + * @return array * * @throws Throwable * @throws TooManyDatabasesException @@ -85,7 +85,7 @@ class DatabaseController extends ClientApiController * the caller. * * - * @return ApiPayload + * @return array * * @throws Throwable */ diff --git a/app/Http/Controllers/Api/Client/Servers/FileController.php b/app/Http/Controllers/Api/Client/Servers/FileController.php index 014780b2a..8519f4a29 100644 --- a/app/Http/Controllers/Api/Client/Servers/FileController.php +++ b/app/Http/Controllers/Api/Client/Servers/FileController.php @@ -114,7 +114,7 @@ class FileController extends ClientApiController * Returns a listing of files in a given directory. * * - * @return ApiPayload + * @return array * * @throws DaemonConnectionException */ @@ -257,7 +257,7 @@ class FileController extends ClientApiController } /** - * @return ApiPayload + * @return array * * @throws DaemonConnectionException */ diff --git a/app/Http/Controllers/Api/Client/Servers/NetworkAllocationController.php b/app/Http/Controllers/Api/Client/Servers/NetworkAllocationController.php index 1fc63e993..ec7f9bbae 100644 --- a/app/Http/Controllers/Api/Client/Servers/NetworkAllocationController.php +++ b/app/Http/Controllers/Api/Client/Servers/NetworkAllocationController.php @@ -54,7 +54,7 @@ class NetworkAllocationController extends ClientApiController * Lists all the allocations available to a server and whether * they are currently assigned as the primary for this server. * - * @return ApiPayload + * @return array */ #[Endpoint('List server allocations', 'Returns all network allocations assigned to the server.')] #[ResponseFromTransformer(AllocationTransformer::class, Allocation::class, description: 'Server allocations returned.', collection: true, factoryStates: ['withServer'], resourceKey: 'allocation')] @@ -66,7 +66,7 @@ class NetworkAllocationController extends ClientApiController } /** - * @return ApiPayload + * @return array */ #[Endpoint('Update allocation notes', 'Updates notes attached to a server allocation.')] #[ResponseFromTransformer(AllocationTransformer::class, Allocation::class, description: 'Allocation notes updated.', factoryStates: ['withServer'], resourceKey: 'allocation')] @@ -82,7 +82,7 @@ class NetworkAllocationController extends ClientApiController /** * Set the primary allocation for a server. * - * @return ApiPayload + * @return array */ #[Endpoint('Set primary allocation', 'Sets the primary network allocation for the server.')] #[ResponseFromTransformer(AllocationTransformer::class, Allocation::class, description: 'Primary allocation updated.', factoryStates: ['withServer'], resourceKey: 'allocation')] @@ -96,7 +96,7 @@ class NetworkAllocationController extends ClientApiController } /** - * @return ApiPayload + * @return array * * @throws DisplayException */ diff --git a/app/Http/Controllers/Api/Client/Servers/ResourceUtilizationController.php b/app/Http/Controllers/Api/Client/Servers/ResourceUtilizationController.php index 9ede236a3..d70dc7c7c 100644 --- a/app/Http/Controllers/Api/Client/Servers/ResourceUtilizationController.php +++ b/app/Http/Controllers/Api/Client/Servers/ResourceUtilizationController.php @@ -53,7 +53,7 @@ class ResourceUtilizationController extends ClientApiController * a flood of unnecessary API calls. * * - * @return ApiPayload + * @return array * * @throws DaemonConnectionException */ diff --git a/app/Http/Controllers/Api/Client/Servers/ScheduleController.php b/app/Http/Controllers/Api/Client/Servers/ScheduleController.php index bbef6924c..fc2da5be2 100644 --- a/app/Http/Controllers/Api/Client/Servers/ScheduleController.php +++ b/app/Http/Controllers/Api/Client/Servers/ScheduleController.php @@ -48,7 +48,7 @@ class ScheduleController extends ClientApiController /** * Returns all the schedules belonging to a given server. * - * @return ApiPayload + * @return array */ #[Endpoint('List server schedules', 'Returns all schedules configured for the server, including their tasks.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports tasks.', required: false, example: 'tasks')] @@ -66,7 +66,7 @@ class ScheduleController extends ClientApiController * Store a new schedule for a server. * * - * @return ApiPayload + * @return array * * @throws DisplayException */ @@ -87,7 +87,7 @@ class ScheduleController extends ClientApiController /** * Returns a specific schedule for the server. * - * @return ApiPayload + * @return array */ #[Endpoint('Get server schedule', 'Returns one schedule configured for the server, including its tasks.')] #[QueryParam('include', 'string', 'Comma-separated relationships to include. Supports tasks.', required: false, example: 'tasks')] @@ -107,7 +107,7 @@ class ScheduleController extends ClientApiController * Updates a given schedule with the new data provided. * * - * @return ApiPayload + * @return array * * @throws DisplayException */ diff --git a/app/Http/Controllers/Api/Client/Servers/ScheduleTaskController.php b/app/Http/Controllers/Api/Client/Servers/ScheduleTaskController.php index 867a2109c..8a8dfe906 100644 --- a/app/Http/Controllers/Api/Client/Servers/ScheduleTaskController.php +++ b/app/Http/Controllers/Api/Client/Servers/ScheduleTaskController.php @@ -42,7 +42,7 @@ class ScheduleTaskController extends ClientApiController * Create a new task for a given schedule and store it in the database. * * - * @return ApiPayload + * @return array * * @throws ServiceLimitExceededException */ @@ -62,7 +62,7 @@ class ScheduleTaskController extends ClientApiController * Updates a given task for a server. * * - * @return ApiPayload + * @return array */ #[Endpoint('Update schedule task', 'Updates a task in a server schedule, including its sequence position.')] #[ResponseFromTransformer(TaskTransformer::class, Task::class, description: 'Schedule task updated.', resourceKey: 'schedule_task')] diff --git a/app/Http/Controllers/Api/Client/Servers/ServerController.php b/app/Http/Controllers/Api/Client/Servers/ServerController.php index c62de29cb..dbe1dc3a5 100644 --- a/app/Http/Controllers/Api/Client/Servers/ServerController.php +++ b/app/Http/Controllers/Api/Client/Servers/ServerController.php @@ -23,7 +23,7 @@ class ServerController extends ClientApiController * Transform an individual server into a response that can be consumed by a * client using the API. * - * @return ApiPayload + * @return array */ #[Endpoint('Get server', 'Returns details for one server the authenticated user can access.')] #[ResponseFromTransformer(ServerTransformer::class, Server::class, description: 'Server details returned.', factoryStates: ['withRelationships'], resourceKey: 'server', meta: ['is_server_owner' => true, 'user_permissions' => ['websocket.connect', 'control.console', 'control.start', 'control.stop', 'control.restart']])] diff --git a/app/Http/Controllers/Api/Client/Servers/StartupController.php b/app/Http/Controllers/Api/Client/Servers/StartupController.php index bfaa14c75..0acaa068f 100644 --- a/app/Http/Controllers/Api/Client/Servers/StartupController.php +++ b/app/Http/Controllers/Api/Client/Servers/StartupController.php @@ -38,7 +38,7 @@ class StartupController extends ClientApiController /** * Returns the startup information for the server including all the variables. * - * @return ApiPayload + * @return array */ #[Endpoint('Get startup configuration', 'Returns the rendered startup command, available Docker images, raw startup command, and user-visible variables for the server.')] #[ResponseFromTransformer(EggVariableTransformer::class, EggVariable::class, description: 'Startup configuration returned.', collection: true, factoryStates: ['viewable', 'editable'], resourceKey: 'egg_variable', meta: ['startup_command' => 'java -Xms128M -Xmx1024M -jar paper.jar', 'docker_images' => ['Java 23' => 'ghcr.io/pterodactyl/yolks:java_23'], 'raw_startup_command' => 'java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}'])] @@ -62,7 +62,7 @@ class StartupController extends ClientApiController /** * Updates a single variable for a server. * - * @return ApiPayload + * @return array */ #[Endpoint('Update startup variable', 'Updates one editable startup variable for the server and returns the updated rendered startup command.')] #[ResponseFromTransformer(EggVariableTransformer::class, EggVariable::class, description: 'Startup variable updated.', factoryStates: ['viewable', 'editable'], resourceKey: 'egg_variable', meta: ['startup_command' => 'java -Xms128M -Xmx1024M -jar paper.jar', 'raw_startup_command' => 'java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}'])] diff --git a/app/Http/Controllers/Api/Client/Servers/SubuserController.php b/app/Http/Controllers/Api/Client/Servers/SubuserController.php index a71244f03..b36c441a2 100644 --- a/app/Http/Controllers/Api/Client/Servers/SubuserController.php +++ b/app/Http/Controllers/Api/Client/Servers/SubuserController.php @@ -43,7 +43,7 @@ class SubuserController extends ClientApiController /** * Return the users associated with this server instance. * - * @return ApiPayload + * @return array */ #[Endpoint('List server subusers', 'Returns subusers assigned to the server.')] #[ResponseFromTransformer(SubuserTransformer::class, Subuser::class, description: 'Server subusers returned.', collection: true, resourceKey: 'server_subuser')] @@ -57,7 +57,7 @@ class SubuserController extends ClientApiController /** * Returns a single subuser associated with this server instance. * - * @return ApiPayload + * @return array */ #[Endpoint('Get server subuser', 'Returns one subuser assignment for the server.')] #[ResponseFromTransformer(SubuserTransformer::class, Subuser::class, description: 'Server subuser returned.', resourceKey: 'server_subuser')] @@ -74,7 +74,7 @@ class SubuserController extends ClientApiController * Create a new subuser for the given server. * * - * @return ApiPayload + * @return array * * @throws ServerSubuserExistsException * @throws UserIsServerOwnerException @@ -96,7 +96,7 @@ class SubuserController extends ClientApiController * Update a given subuser in the system for the server. * * - * @return ApiPayload + * @return array */ #[Endpoint('Update server subuser', 'Updates permissions for a server subuser and revokes their SFTP access tokens.')] #[ResponseFromTransformer(SubuserTransformer::class, Subuser::class, description: 'Server subuser updated.', resourceKey: 'server_subuser')] diff --git a/app/Http/Controllers/Base/LocaleController.php b/app/Http/Controllers/Base/LocaleController.php index 2f59dad22..1575d06ec 100644 --- a/app/Http/Controllers/Base/LocaleController.php +++ b/app/Http/Controllers/Base/LocaleController.php @@ -9,7 +9,6 @@ use Illuminate\Http\JsonResponse; use Illuminate\Translation\Translator; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Http\Requests\Base\LocaleRequest; -use Pterodactyl\Support\JsonValueGuard; use UnexpectedValueException; class LocaleController extends Controller @@ -32,7 +31,6 @@ class LocaleController extends Controller $translations = count($segments) === 2 ? $this->loader->load($locale, $segments[1], $segments[0]) : $this->loader->load($locale, $namespace); - JsonValueGuard::assertValue($translations); $response[$locale][$namespace] = $this->i18n($translations); $json = new JsonResponse($response, 200, [ @@ -59,8 +57,8 @@ class LocaleController extends Controller * into key structures that are supported by the front-end i18n * library, like "{{foo}}". * - * @param array $data - * @return array + * @param array $data + * @return array */ protected function i18n(array $data): array { diff --git a/app/Http/Requests/Api/Admin/ApiKeys/StoreApiKeyRequest.php b/app/Http/Requests/Api/Admin/ApiKeys/StoreApiKeyRequest.php index 9d475d36a..bcb4428be 100644 --- a/app/Http/Requests/Api/Admin/ApiKeys/StoreApiKeyRequest.php +++ b/app/Http/Requests/Api/Admin/ApiKeys/StoreApiKeyRequest.php @@ -38,7 +38,7 @@ class StoreApiKeyRequest extends AdminApiRequest * The validated input without the resource permissions, which getKeyPermissions() * returns. * - * @return ActionInput + * @return array */ public function actionInput(): array { @@ -48,7 +48,7 @@ class StoreApiKeyRequest extends AdminApiRequest /** * The validated resource permissions, keyed by r_* column, for the action to read. * - * @return ActionInput + * @return array */ public function getKeyPermissions(): array { diff --git a/app/Http/Requests/Api/Admin/Servers/Databases/StoreDatabaseRequest.php b/app/Http/Requests/Api/Admin/Servers/Databases/StoreDatabaseRequest.php index 0eac353b2..7bfdc7611 100644 --- a/app/Http/Requests/Api/Admin/Servers/Databases/StoreDatabaseRequest.php +++ b/app/Http/Requests/Api/Admin/Servers/Databases/StoreDatabaseRequest.php @@ -50,7 +50,7 @@ class StoreDatabaseRequest extends AdminApiRequest * The validated input, with the database name prefixed for the action. A database * created without a connection limit gets none. * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Api/Admin/Servers/StoreServerRequest.php b/app/Http/Requests/Api/Admin/Servers/StoreServerRequest.php index 2f56a2ca1..63b4c0df0 100644 --- a/app/Http/Requests/Api/Admin/Servers/StoreServerRequest.php +++ b/app/Http/Requests/Api/Admin/Servers/StoreServerRequest.php @@ -88,7 +88,7 @@ class StoreServerRequest extends AdminApiRequest * primary_allocation_id and secondary_allocations_ids its allocation_id and * allocation_additional. The deployment goes to the action as getDeploymentObject(). * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Api/Admin/Servers/UpdateServerBuildConfigurationRequest.php b/app/Http/Requests/Api/Admin/Servers/UpdateServerBuildConfigurationRequest.php index e8eb7c142..c683a85dc 100644 --- a/app/Http/Requests/Api/Admin/Servers/UpdateServerBuildConfigurationRequest.php +++ b/app/Http/Requests/Api/Admin/Servers/UpdateServerBuildConfigurationRequest.php @@ -50,7 +50,7 @@ class UpdateServerBuildConfigurationRequest extends ServerWriteRequest * The validated input under the action's field names: add_allocation_ids and * remove_allocation_ids are its add_allocations and remove_allocations. * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Api/Admin/Users/StoreUserRequest.php b/app/Http/Requests/Api/Admin/Users/StoreUserRequest.php index eda5c14f3..1df843dd3 100644 --- a/app/Http/Requests/Api/Admin/Users/StoreUserRequest.php +++ b/app/Http/Requests/Api/Admin/Users/StoreUserRequest.php @@ -53,7 +53,7 @@ class StoreUserRequest extends AdminApiRequest * The validated input, with the language sent under `preferences` moved to the * action's `language` key. * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Api/ApiRequest.php b/app/Http/Requests/Api/ApiRequest.php index df607f5af..a5677b8cb 100644 --- a/app/Http/Requests/Api/ApiRequest.php +++ b/app/Http/Requests/Api/ApiRequest.php @@ -7,7 +7,6 @@ namespace Pterodactyl\Http\Requests\Api; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Http\FormRequest; use InvalidArgumentException; -use Pterodactyl\Support\JsonValueGuard; abstract class ApiRequest extends FormRequest { @@ -29,14 +28,11 @@ abstract class ApiRequest extends FormRequest * The validated input, for an action that validates it again itself so that * extensions and commands calling the action directly meet the same rules. * - * @return ActionInput + * @return array */ public function actionInput(): array { - $validated = $this->validated(); - JsonValueGuard::assertPayload9($validated); - - return $validated; + return $this->validated(); } public function perPage(int $default = self::DEFAULT_PER_PAGE): int diff --git a/app/Http/Requests/Api/Application/Allocations/StoreAllocationRequest.php b/app/Http/Requests/Api/Application/Allocations/StoreAllocationRequest.php index 5a45164af..c0cd779af 100644 --- a/app/Http/Requests/Api/Application/Allocations/StoreAllocationRequest.php +++ b/app/Http/Requests/Api/Application/Allocations/StoreAllocationRequest.php @@ -30,7 +30,7 @@ class StoreAllocationRequest extends ApplicationApiRequest * The validated input under the action's field names: ip, ports and alias are its * allocation_ip, allocation_ports and allocation_alias. * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Api/Application/Servers/Databases/StoreServerDatabaseRequest.php b/app/Http/Requests/Api/Application/Servers/Databases/StoreServerDatabaseRequest.php index aa6cde936..93b4d8717 100644 --- a/app/Http/Requests/Api/Application/Servers/Databases/StoreServerDatabaseRequest.php +++ b/app/Http/Requests/Api/Application/Servers/Databases/StoreServerDatabaseRequest.php @@ -45,7 +45,7 @@ class StoreServerDatabaseRequest extends ApplicationApiRequest * The validated input under the action's field names: the database name gets its * "s{server_id}_" prefix, and host is the action's database_host_id. * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php b/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php index c38215ac1..677df4779 100644 --- a/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php +++ b/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php @@ -91,7 +91,7 @@ class StoreServerRequest extends ApplicationApiRequest * additional allocations move to its top level, read with Laravel's typed accessors. The * deployment goes to the action as getDeploymentObject(). * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Api/Application/Servers/UpdateServerBuildConfigurationRequest.php b/app/Http/Requests/Api/Application/Servers/UpdateServerBuildConfigurationRequest.php index 824670773..206a80e85 100644 --- a/app/Http/Requests/Api/Application/Servers/UpdateServerBuildConfigurationRequest.php +++ b/app/Http/Requests/Api/Application/Servers/UpdateServerBuildConfigurationRequest.php @@ -59,7 +59,7 @@ class UpdateServerBuildConfigurationRequest extends ServerWriteRequest * and the feature limits move to its top level. A limit sent both under limits and flat * is taken from limits, read with Laravel's typed accessors. * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Api/Application/Servers/UpdateServerDetailsRequest.php b/app/Http/Requests/Api/Application/Servers/UpdateServerDetailsRequest.php index 099799906..143e697fa 100644 --- a/app/Http/Requests/Api/Application/Servers/UpdateServerDetailsRequest.php +++ b/app/Http/Requests/Api/Application/Servers/UpdateServerDetailsRequest.php @@ -35,7 +35,7 @@ class UpdateServerDetailsRequest extends ServerWriteRequest /** * The validated input under the action's field names: user is its owner_id. * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Api/Application/Servers/UpdateServerStartupRequest.php b/app/Http/Requests/Api/Application/Servers/UpdateServerStartupRequest.php index 9c390c988..61a82dc25 100644 --- a/app/Http/Requests/Api/Application/Servers/UpdateServerStartupRequest.php +++ b/app/Http/Requests/Api/Application/Servers/UpdateServerStartupRequest.php @@ -38,7 +38,7 @@ class UpdateServerStartupRequest extends ApplicationApiRequest * The validated input under the action's field names: egg and image are its egg_id * and docker_image. * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Api/Application/Users/StoreUserRequest.php b/app/Http/Requests/Api/Application/Users/StoreUserRequest.php index c319fae0c..528616c38 100644 --- a/app/Http/Requests/Api/Application/Users/StoreUserRequest.php +++ b/app/Http/Requests/Api/Application/Users/StoreUserRequest.php @@ -51,7 +51,7 @@ class StoreUserRequest extends ApplicationApiRequest * The validated input under the action's field names: first_name and last_name are * its name_first and name_last. * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Requests/Concerns/ValidatesExtensionFields.php b/app/Http/Requests/Concerns/ValidatesExtensionFields.php index f82fd724d..38db91eff 100644 --- a/app/Http/Requests/Concerns/ValidatesExtensionFields.php +++ b/app/Http/Requests/Concerns/ValidatesExtensionFields.php @@ -40,7 +40,7 @@ trait ValidatesExtensionFields /** * The validated input, with the validated extension field values under `extensions`. * - * @return ActionInput + * @return array */ public function actionInput(): array { diff --git a/app/Http/Resources/Api/Admin/ServerDatabaseResource.php b/app/Http/Resources/Api/Admin/ServerDatabaseResource.php index c267e04d6..5a355859b 100644 --- a/app/Http/Resources/Api/Admin/ServerDatabaseResource.php +++ b/app/Http/Resources/Api/Admin/ServerDatabaseResource.php @@ -32,7 +32,7 @@ class ServerDatabaseResource extends AdminResource } /** - * @return ApiPayload + * @return array */ public function toArray(Request $request): array { diff --git a/app/Http/Resources/Api/ApiResource.php b/app/Http/Resources/Api/ApiResource.php index a607b4fed..b24f44163 100644 --- a/app/Http/Resources/Api/ApiResource.php +++ b/app/Http/Resources/Api/ApiResource.php @@ -111,7 +111,7 @@ abstract class ApiResource extends JsonResource implements IncludedResource * includes go in `relationships`: emitting it empty keeps its place, otherwise it is * appended last when something is included. * - * @return ApiPayload + * @return array */ public function toArray(Request $request): array { @@ -248,7 +248,7 @@ abstract class ApiResource extends JsonResource implements IncludedResource * @template TData of ApiResourceData * * @param TData $data - * @param class-string>|Closure(TData): ApiPayload $resource + * @param class-string>|Closure(TData): array $resource * @return ApiResource */ protected function item(Model|ServerState|array $data, string|Closure $resource, ?string $resourceKey = null): self @@ -264,7 +264,7 @@ abstract class ApiResource extends JsonResource implements IncludedResource * @template TData of ApiResourceData * * @param array|Collection $data - * @param class-string>|Closure(TData): ApiPayload $resource + * @param class-string>|Closure(TData): array $resource */ protected function items(array|Collection $data, string|Closure $resource, ?string $resourceKey = null): ApiResourceCollection { diff --git a/app/Http/Resources/Api/Application/EggVariableResource.php b/app/Http/Resources/Api/Application/EggVariableResource.php index d346d5c2e..90dc51d3d 100644 --- a/app/Http/Resources/Api/Application/EggVariableResource.php +++ b/app/Http/Resources/Api/Application/EggVariableResource.php @@ -7,7 +7,6 @@ namespace Pterodactyl\Http\Resources\Api\Application; use Illuminate\Http\Request; use Pterodactyl\Models\Egg; use Pterodactyl\Models\EggVariable; -use Pterodactyl\Support\JsonValueGuard; /** * @extends ApplicationResource @@ -20,13 +19,10 @@ class EggVariableResource extends ApplicationResource } /** - * @return ApiPayload + * @return array */ public function toArray(Request $request): array { - $attributes = $this->resource->attributesToArray(); - JsonValueGuard::assertPayload($attributes); - - return $attributes; + return $this->resource->attributesToArray(); } } diff --git a/app/Http/Resources/Api/Application/ServerVariableResource.php b/app/Http/Resources/Api/Application/ServerVariableResource.php index 7c499bf96..307fc03c4 100644 --- a/app/Http/Resources/Api/Application/ServerVariableResource.php +++ b/app/Http/Resources/Api/Application/ServerVariableResource.php @@ -11,7 +11,6 @@ use Pterodactyl\Http\Resources\Api\NullResource; use Pterodactyl\Models\EggVariable; use Pterodactyl\Models\ServerVariable; use Pterodactyl\Services\Acl\Api\AdminAcl; -use Pterodactyl\Support\JsonValueGuard; /** * @extends ApplicationResource @@ -33,14 +32,11 @@ class ServerVariableResource extends ApplicationResource /** * Return a generic transformed server variable array. * - * @return ApiPayload + * @return array */ public function toArray(Request $request): array { - $attributes = $this->resource->attributesToArray(); - JsonValueGuard::assertPayload($attributes); - - return $attributes; + return $this->resource->attributesToArray(); } protected function resolveInclude(string $include): ?IncludedResource diff --git a/app/Http/Resources/Api/CallbackResource.php b/app/Http/Resources/Api/CallbackResource.php index 06c6da49c..efce896ce 100644 --- a/app/Http/Resources/Api/CallbackResource.php +++ b/app/Http/Resources/Api/CallbackResource.php @@ -24,7 +24,7 @@ final class CallbackResource extends ApiResource { /** * @param TResource $resource - * @param Closure(TResource): ApiPayload $callback + * @param Closure(TResource): array $callback */ public function __construct($resource, private readonly Closure $callback, private readonly ?string $name = null) { @@ -37,7 +37,7 @@ final class CallbackResource extends ApiResource * @template TData of ApiResourceData * * @param array|Collection|AbstractPaginator $resource - * @param Closure(TData): ApiPayload $callback + * @param Closure(TData): array $callback */ public static function list(array|Collection|AbstractPaginator $resource, Closure $callback, ?string $name = null): ApiResourceCollection { @@ -69,7 +69,7 @@ final class CallbackResource extends ApiResource } /** - * @return ApiPayload + * @return array */ public function toArray(Request $request): array { diff --git a/app/Http/Resources/Api/Client/DatabaseResource.php b/app/Http/Resources/Api/Client/DatabaseResource.php index 9edcd1f1e..6cd8b9d1e 100644 --- a/app/Http/Resources/Api/Client/DatabaseResource.php +++ b/app/Http/Resources/Api/Client/DatabaseResource.php @@ -34,7 +34,7 @@ class DatabaseResource extends ClientResource } /** - * @return ApiPayload + * @return array */ public function toArray(Request $request): array { diff --git a/app/Http/Resources/Api/Client/UserSSHKeyResource.php b/app/Http/Resources/Api/Client/UserSSHKeyResource.php index e09140b27..25689f7b0 100644 --- a/app/Http/Resources/Api/Client/UserSSHKeyResource.php +++ b/app/Http/Resources/Api/Client/UserSSHKeyResource.php @@ -20,7 +20,7 @@ class UserSSHKeyResource extends ClientResource /** * Return's a user's SSH key in an API response format. * - * @return ApiPayload + * @return array */ public function toArray(Request $request): array { diff --git a/app/Http/Resources/Wings/ServerConfigurationCollection.php b/app/Http/Resources/Wings/ServerConfigurationCollection.php index 1d4343048..f1a4f9bf4 100644 --- a/app/Http/Resources/Wings/ServerConfigurationCollection.php +++ b/app/Http/Resources/Wings/ServerConfigurationCollection.php @@ -8,7 +8,6 @@ use Illuminate\Http\Resources\Json\ResourceCollection; use Pterodactyl\Models\Server; use Pterodactyl\Services\Eggs\EggConfigurationService; use Pterodactyl\Services\Servers\ServerConfigurationStructureService; -use Pterodactyl\Support\JsonValueGuard; use UnexpectedValueException; class ServerConfigurationCollection extends ResourceCollection @@ -27,7 +26,7 @@ class ServerConfigurationCollection extends ResourceCollection * relationships on the Server models before calling this function, otherwise you'll * have some serious performance issues from all the N+1 queries. * - * @return array, process_configuration: array}> + * @return array, process_configuration: array}> */ public function toArray($request): array { @@ -36,7 +35,6 @@ class ServerConfigurationCollection extends ResourceCollection throw_unless($server instanceof Server, UnexpectedValueException::class, 'Server configuration resources require Server models.'); $processConfiguration = $this->egg->handle($server); - JsonValueGuard::assertPayload9($processConfiguration); $result[] = [ 'uuid' => $server->uuid, diff --git a/app/Listeners/AuthenticationListener.php b/app/Listeners/AuthenticationListener.php index 86f5b4a18..a7239efc5 100644 --- a/app/Listeners/AuthenticationListener.php +++ b/app/Listeners/AuthenticationListener.php @@ -10,7 +10,6 @@ use Illuminate\Contracts\Events\Dispatcher; use Pterodactyl\Events\Auth\DirectLogin; use Pterodactyl\Extensions\Illuminate\Events\Contracts\SubscribesToEvents; use Pterodactyl\Facades\Activity; -use Pterodactyl\Support\JsonValueGuard; class AuthenticationListener implements SubscribesToEvents { @@ -27,7 +26,6 @@ class AuthenticationListener implements SubscribesToEvents if ($event instanceof Failed) { foreach ($event->credentials as $key => $value) { - JsonValueGuard::assertValue($value); $activity = $activity->property($key, $value); } } diff --git a/app/Models/ActivityLog.php b/app/Models/ActivityLog.php index 379704d34..50f15921c 100644 --- a/app/Models/ActivityLog.php +++ b/app/Models/ActivityLog.php @@ -22,7 +22,6 @@ use LogicException; use Pterodactyl\Contracts\Models\Identifiable; use Pterodactyl\Events\ActivityLogged; use Pterodactyl\Models\Traits\HasRealtimeIdentifier; -use Pterodactyl\Support\JsonValueGuard; /** * \Pterodactyl\Models\ActivityLog. @@ -35,7 +34,7 @@ use Pterodactyl\Support\JsonValueGuard; * @property string|null $actor_type * @property int|null $actor_id * @property int|null $api_key_id - * @property Collection $properties + * @property Collection $properties * @property Carbon $timestamp * @property IlluminateModel|null $actor * @property \Illuminate\Database\Eloquent\Collection $subjects @@ -124,13 +123,10 @@ class ActivityLog extends Model implements Identifiable return $this->hasOne(ApiKey::class, 'id', 'api_key_id'); } - /** @return array */ + /** @return array */ public function propertyValues(): array { - $values = $this->properties->all(); - JsonValueGuard::assertValue($values); - - return $values; + return $this->properties->all(); } /** diff --git a/app/Models/Objects/DeploymentObject.php b/app/Models/Objects/DeploymentObject.php index 3ff9d095a..96dd60eab 100644 --- a/app/Models/Objects/DeploymentObject.php +++ b/app/Models/Objects/DeploymentObject.php @@ -20,7 +20,7 @@ class DeploymentObject * Individual ports and port ranges exactly as they arrived from the request; * AllocationSelectionService discards the entries it cannot use. * - * @var list + * @var list */ private array $ports = []; @@ -63,7 +63,7 @@ class DeploymentObject } /** - * @return list + * @return list */ public function getPorts(): array { @@ -71,7 +71,7 @@ class DeploymentObject } /** - * @param list $ports + * @param list $ports */ public function setPorts(array $ports): self { diff --git a/app/Models/User.php b/app/Models/User.php index 4786bceed..2b7a17968 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -166,7 +166,7 @@ class User extends Authenticatable implements Identifiable } /** - * @return ApiPayload + * @return array */ public function toVueObject(): array { diff --git a/app/Policies/ServerPolicy.php b/app/Policies/ServerPolicy.php index 60e0cd5fa..4da6174b9 100644 --- a/app/Policies/ServerPolicy.php +++ b/app/Policies/ServerPolicy.php @@ -14,7 +14,7 @@ class ServerPolicy * not call the before() function if there isn't a function matching the * policy permission. */ - /** @param list $arguments */ + /** @param list $arguments */ public function __call(string $name, array $arguments): void { // do nothing diff --git a/app/Rules/Fqdn.php b/app/Rules/Fqdn.php index f0fa85a72..27048022e 100644 --- a/app/Rules/Fqdn.php +++ b/app/Rules/Fqdn.php @@ -12,7 +12,7 @@ use Illuminate\Support\Arr; class Fqdn implements DataAwareRule, ValidationRule { /** - * @var ValidationData + * @var array */ protected array $data = []; @@ -29,7 +29,7 @@ class Fqdn implements DataAwareRule, ValidationRule } /** - * @param ValidationData $data + * @param array $data */ public function setData($data): self { diff --git a/app/Services/Activity/ActivityLogBatchService.php b/app/Services/Activity/ActivityLogBatchService.php index 53ea74e2d..39ef75ec5 100644 --- a/app/Services/Activity/ActivityLogBatchService.php +++ b/app/Services/Activity/ActivityLogBatchService.php @@ -52,7 +52,7 @@ class ActivityLogBatchService * Executes the logic provided within the callback in the scope of an activity * log batch transaction. * - * @template TReturn of object|ApiValue10 + * @template TReturn * * @param Closure(?string): TReturn $callback * @return TReturn diff --git a/app/Services/Activity/ActivityLogService.php b/app/Services/Activity/ActivityLogService.php index 499c1ffe5..a53f559b1 100644 --- a/app/Services/Activity/ActivityLogService.php +++ b/app/Services/Activity/ActivityLogService.php @@ -14,8 +14,6 @@ use Illuminate\Support\Facades\Log; use InvalidArgumentException; use Pterodactyl\Models\ActivityLog; use Pterodactyl\Models\ActivityLogSubject; -use Pterodactyl\Support\JsonEmptyObject; -use Pterodactyl\Support\JsonValueGuard; use Throwable; class ActivityLogService @@ -107,10 +105,10 @@ class ActivityLogService /** * Sets a custom property on the activity log instance. * - * @param string|array $key - * @param JsonInputValue $value Ignored when an array of properties is provided. + * @param string|array $key + * @param mixed $value Ignored when an array of properties is provided. */ - public function property(array|string $key, array|bool|float|int|string|JsonEmptyObject|null $value = null): self + public function property(array|string $key, mixed $value = null): self { $activity = $this->getActivity(); $properties = $activity->properties; @@ -119,7 +117,6 @@ class ActivityLogService $properties->put($name, $property); } } else { - JsonValueGuard::assertValue($value); $properties->put($key, $value); } diff --git a/app/Services/Daemon/DaemonConnection.php b/app/Services/Daemon/DaemonConnection.php index a9b1f9123..50515f0a4 100644 --- a/app/Services/Daemon/DaemonConnection.php +++ b/app/Services/Daemon/DaemonConnection.php @@ -17,7 +17,7 @@ use Pterodactyl\Models\Node; use Pterodactyl\Support\JsonValueGuard; use UnexpectedValueException; -/** @phpstan-type RequestOptions array{json?: ApiPayload, query?: array, body?: string, timeout?: int} */ +/** @phpstan-type RequestOptions array{json?: array, query?: array, body?: string, timeout?: int} */ final readonly class DaemonConnection { private function __construct(private string $url, private string $token) {} @@ -52,7 +52,7 @@ final readonly class DaemonConnection /** * @param NormalizedValidationRules $rules - * @return array + * @return array */ public function decode(Response $response, array $rules = [], bool $expectsList = false): array { diff --git a/app/Services/Daemon/FilesClient.php b/app/Services/Daemon/FilesClient.php index efa342aff..f6e96fc15 100644 --- a/app/Services/Daemon/FilesClient.php +++ b/app/Services/Daemon/FilesClient.php @@ -64,7 +64,7 @@ final readonly class FilesClient ]); } - /** @param array $files */ + /** @param array $files */ public function renameFiles(?string $root, array $files): Response { return $this->connection->request('PUT', "/api/servers/{$this->uuid}/files/rename", [ @@ -79,7 +79,7 @@ final readonly class FilesClient ]); } - /** @param array $files */ + /** @param array $files */ public function deleteFiles(?string $root, array $files): Response { return $this->connection->request('POST', "/api/servers/{$this->uuid}/files/delete", [ @@ -88,7 +88,7 @@ final readonly class FilesClient } /** - * @param array $files + * @param array $files * @return DaemonFileObject */ public function compressFiles(?string $root, array $files): array @@ -112,7 +112,7 @@ final readonly class FilesClient ]); } - /** @param array $files */ + /** @param array $files */ public function chmodFiles(?string $root, array $files): Response { return $this->connection->request('POST', "/api/servers/{$this->uuid}/files/chmod", [ @@ -120,7 +120,7 @@ final readonly class FilesClient ]); } - /** @param array $params */ + /** @param array $params */ public function pull(string $url, ?string $directory, array $params = []): Response { $input = Fluent::make($params); diff --git a/app/Services/Daemon/NodeClient.php b/app/Services/Daemon/NodeClient.php index 209135978..4ce3d250e 100644 --- a/app/Services/Daemon/NodeClient.php +++ b/app/Services/Daemon/NodeClient.php @@ -17,7 +17,7 @@ final readonly class NodeClient return new self(DaemonConnection::forNode($node)); } - /** @return ApiPayload */ + /** @return array */ public function systemInformation(?int $version = null): array { $response = $this->connection->request('GET', '/api/system', [ diff --git a/app/Services/Deployment/AllocationSelectionService.php b/app/Services/Deployment/AllocationSelectionService.php index f4600b4e4..dffe53e41 100644 --- a/app/Services/Deployment/AllocationSelectionService.php +++ b/app/Services/Deployment/AllocationSelectionService.php @@ -61,8 +61,8 @@ class AllocationSelectionService * empty, all ports will be considered when finding an allocation. If set, only ports appearing * in the array or range will be used. * - * @param list $ports Entries that are neither a port nor a port range - * are discarded rather than rejected. + * @param list $ports Entries that are neither a port nor a port range + * are discarded rather than rejected. * * @throws DisplayException */ diff --git a/app/Services/Eggs/EggConfigurationService.php b/app/Services/Eggs/EggConfigurationService.php index c2e04b4ff..5629b1c72 100644 --- a/app/Services/Eggs/EggConfigurationService.php +++ b/app/Services/Eggs/EggConfigurationService.php @@ -10,8 +10,7 @@ use JsonException; use Pterodactyl\Models\Server; use Pterodactyl\Services\Servers\ServerConfigurationStructureService; use Pterodactyl\Support\JsonEmptyObject; -use Pterodactyl\Support\JsonValueGuard; -use Pterodactyl\Support\JsonValueTree; +use Stringable; use UnexpectedValueException; class EggConfigurationService @@ -25,7 +24,7 @@ class EggConfigurationService * Return an Egg file to be used by the Daemon. * * @return array{ - * startup: array{done: ApiValue9, user_interaction: array{}, strip_ansi: ApiValue9}, + * startup: array{done: mixed, user_interaction: array{}, strip_ansi: mixed}, * stop: array{type: string, value: string}, * configs: EggConfigurationOutputs, * } @@ -45,8 +44,8 @@ class EggConfigurationService /** * Convert the "done" variable into an array if it is not currently one. * - * @param array $startup - * @return array{done: ApiValue9, user_interaction: array{}, strip_ansi: ApiValue9} + * @param array $startup + * @return array{done: mixed, user_interaction: array{}, strip_ansi: mixed} */ protected function convertStartupToNewFormat(array $startup): array { @@ -152,7 +151,7 @@ class EggConfigurationService } /** - * @param array $structure the legacy server configuration structure + * @param array $structure the legacy server configuration structure */ protected function matchAndReplaceKeys(string $value, array $structure): string { @@ -180,7 +179,6 @@ class EggConfigurationService // array that used to be created for the old daemon. if (Str::startsWith($key, 'server.')) { $plucked = Arr::get($structure, Str::after($key, 'server.'), ''); - JsonValueGuard::assertValue($plucked); $value = str_replace("{{{$key}}}", $this->placeholderValue($plucked), $value); continue; @@ -194,7 +192,6 @@ class EggConfigurationService '' ); - JsonValueGuard::assertValue($plucked); $value = str_replace("{{{$key}}}", $this->placeholderValue($plucked), $value); } @@ -202,23 +199,21 @@ class EggConfigurationService } /** - * Iterates over a set of "find" values for a given file in the parser configuration. If - * the value of the line match is something iterable, continue iterating, otherwise perform - * a match & replace. + * Replaces the placeholders in every string of a file's "find" values, at any depth. * - * The egg config is decoded associatively (see handle()), so nested "find" values are - * always arrays rather than objects -- PHP arrays are copy-on-write, so mutating $data - * below only affects this function's local copy, never the caller's. - * - * @param array $data - * @param array $structure the legacy server configuration structure - * @return array + * @param array $data + * @param array $structure the legacy server configuration structure + * @return array */ - private function iterate(mixed $data, array $structure): mixed + private function iterate(array $data, array $structure): array { - return JsonValueTree::from($data) - ->mapStrings(fn (string $value): string => $this->matchAndReplaceKeys($value, $structure)) - ->toArray8(); + array_walk_recursive($data, function (mixed &$value) use ($structure): void { + if (is_string($value)) { + $value = $this->matchAndReplaceKeys($value, $structure); + } + }); + + return $data; } /** @return EggConfigurationFiles */ @@ -252,7 +247,7 @@ class EggConfigurationService * one list, so a block that is empty or not JSON is reported and read as empty rather * than failing the list for every other server. * - * @return array + * @return array */ private function jsonObject(?string $encoded): array { @@ -261,7 +256,7 @@ class EggConfigurationService } try { - $value = JsonValueGuard::decode($encoded); + $value = json_decode($encoded, true, flags: JSON_THROW_ON_ERROR); } catch (JsonException $jsonException) { report($jsonException); @@ -282,26 +277,16 @@ class EggConfigurationService return $object; } - /** @param JsonInputValue $value */ + /** + * The value as PHP's string conversion would give it, with arrays and objects shown as "Array". + */ private function placeholderValue(mixed $value): string { - if ($value === null) { - return ''; - } - - if (is_bool($value)) { - return $value ? '1' : ''; - } - - if (is_array($value)) { - return 'Array'; - } - - if ($value instanceof JsonEmptyObject) { - return 'Array'; - } - - // SAFETY: this preserves PHP's legacy scalar-to-string placeholder conversion after arrays, booleans, and null are handled explicitly. - return (string) $value; + return match (true) { + is_bool($value) => $value ? '1' : '', + is_array($value), $value instanceof JsonEmptyObject => 'Array', + is_scalar($value), $value instanceof Stringable => (string) $value, + default => '', + }; } } diff --git a/app/Services/Eggs/EggImportData.php b/app/Services/Eggs/EggImportData.php index 68f1ae043..7cd3f853a 100644 --- a/app/Services/Eggs/EggImportData.php +++ b/app/Services/Eggs/EggImportData.php @@ -44,7 +44,6 @@ final readonly class EggImportData return self::fromValue(JsonValueGuard::decodeArray8($contents)); } - /** @param JsonInputValue $value */ private static function fromValue(mixed $value): self { $root = self::object($value, 'egg'); @@ -83,7 +82,7 @@ final readonly class EggImportData } /** - * @param array $root + * @param array $root * @return array */ private static function dockerImages(array $root, string $version): array @@ -109,7 +108,6 @@ final readonly class EggImportData } /** - * @param JsonInputValue $value * @return list */ private static function variables(mixed $value): array @@ -136,7 +134,6 @@ final readonly class EggImportData } /** - * @param JsonInputValue $value * @return list */ private static function fileDenylist(mixed $value): array @@ -151,8 +148,7 @@ final readonly class EggImportData } /** - * @param JsonInputValue $value - * @return array + * @return array */ private static function object(mixed $value, string $field): array { @@ -172,7 +168,6 @@ final readonly class EggImportData return $object; } - /** @param JsonInputValue $value */ private static function string(mixed $value, string $field): string { if (! is_string($value)) { @@ -182,13 +177,11 @@ final readonly class EggImportData return $value; } - /** @param JsonInputValue $value */ private static function nullableString(mixed $value, string $field): ?string { return $value === null ? null : self::string($value, $field); } - /** @param JsonInputValue $value */ private static function boolean(mixed $value, string $field): bool { if (! is_bool($value)) { @@ -199,7 +192,6 @@ final readonly class EggImportData } /** - * @param JsonInputValue $value * @return list|null */ private static function nullableStringList(mixed $value, string $field): ?array @@ -208,7 +200,6 @@ final readonly class EggImportData } /** - * @param JsonInputValue $value * @return list */ private static function stringList(mixed $value, string $field): array diff --git a/app/Services/FilesystemChanges.php b/app/Services/FilesystemChanges.php index 8defc8f1d..f28f16845 100644 --- a/app/Services/FilesystemChanges.php +++ b/app/Services/FilesystemChanges.php @@ -15,7 +15,7 @@ final class FilesystemChanges /** * Replace or remove paths, retaining originals until the operation succeeds. * - * @template T of object|ApiValue10|void + * @template T * * @param array $replacements Target paths mapped to staged paths, or null for removal. * @param Closure(): T $callback diff --git a/app/Services/Helpers/SoftwareVersionService.php b/app/Services/Helpers/SoftwareVersionService.php index b430bf2da..1afcdd84f 100644 --- a/app/Services/Helpers/SoftwareVersionService.php +++ b/app/Services/Helpers/SoftwareVersionService.php @@ -106,7 +106,6 @@ class SoftwareVersionService } /** - * @param JsonInputValue $value * @return SoftwareVersionData */ private function normalizeVersionData(mixed $value): array diff --git a/app/Services/Servers/EnvironmentService.php b/app/Services/Servers/EnvironmentService.php index 54afd089c..1c23b3983 100644 --- a/app/Services/Servers/EnvironmentService.php +++ b/app/Services/Servers/EnvironmentService.php @@ -11,14 +11,15 @@ use Pterodactyl\Models\Server; class EnvironmentService { - /** @var array */ + /** @var array */ private array $additional = []; /** * Dynamically configure additional environment variables to be assigned * with a specific server. + * + * @param callable(Server): EnvironmentValue $closure */ - /** @param callable(Server): ApiScalar $closure */ public function setEnvironmentKey(string $key, callable $closure): void { $this->additional[$key] = $closure; @@ -28,7 +29,7 @@ class EnvironmentService * Take all of the environment variables configured for this server and return * them in an easy to process format. * - * @return array environment variable name => value + * @return array environment variable name => value */ public function handle(Server $server): array { @@ -118,17 +119,10 @@ class EnvironmentService return $variables; } - /** - * @phpstan-assert ApiScalar $value - * - * @return ApiScalar - */ private function environmentValue(string $key, mixed $value): bool|float|int|string|null { - if ($value === null || is_bool($value) || is_float($value) || is_int($value) || is_string($value)) { - return $value; - } + throw_unless($value === null || is_scalar($value), InvalidArgumentException::class, sprintf('Server environment variable "%s" must resolve to a JSON scalar.', $key)); - throw new InvalidArgumentException(sprintf('Server environment variable "%s" must resolve to a JSON scalar.', $key)); + return $value; } } diff --git a/app/Services/Servers/ServerConfigurationStructureService.php b/app/Services/Servers/ServerConfigurationStructureService.php index 49fbec45d..cf049dbc4 100644 --- a/app/Services/Servers/ServerConfigurationStructureService.php +++ b/app/Services/Servers/ServerConfigurationStructureService.php @@ -24,8 +24,8 @@ class ServerConfigurationStructureService * DO NOT MODIFY THIS FUNCTION. This powers legacy code handling for the new Wings * daemon, if you modify the structure eggs will break unexpectedly. * - * @param array $override server attributes to override on a cloned model - * @return array + * @param array $override server attributes to override on a cloned model + * @return array */ public function handle(Server $server, array $override = [], bool $legacy = false): array { @@ -51,7 +51,7 @@ class ServerConfigurationStructureService /** * Returns the new data format used for the Wings daemon. * - * @return array + * @return array */ protected function returnCurrentFormat(Server $server, Egg $egg, Allocation $allocation): array { @@ -106,7 +106,7 @@ class ServerConfigurationStructureService * Returns the legacy server data format to continue support for old egg configurations * that have not yet been updated. * - * @return array + * @return array * * @deprecated */ diff --git a/app/Services/Servers/VariableValidatorService.php b/app/Services/Servers/VariableValidatorService.php index 624aa7f9f..6e86bf926 100644 --- a/app/Services/Servers/VariableValidatorService.php +++ b/app/Services/Servers/VariableValidatorService.php @@ -26,7 +26,7 @@ class VariableValidatorService /** * Validate all of the passed data against the given service option variables. * - * @param array $fields environment variable name => submitted value + * @param array $fields environment variable name => submitted value * @return Collection * * @throws ValidationException diff --git a/app/Services/Telemetry/TelemetryCollectionService.php b/app/Services/Telemetry/TelemetryCollectionService.php index d2f36c7c3..664a935ae 100644 --- a/app/Services/Telemetry/TelemetryCollectionService.php +++ b/app/Services/Telemetry/TelemetryCollectionService.php @@ -18,7 +18,6 @@ use Pterodactyl\Models\Node; use Pterodactyl\Models\Server; use Pterodactyl\Models\Setting; use Pterodactyl\Models\User; -use Pterodactyl\Support\JsonValueGuard; use Ramsey\Uuid\Uuid; class TelemetryCollectionService @@ -26,7 +25,7 @@ class TelemetryCollectionService /** * Collects telemetry data and returns it as an array. * - * @return ApiPayload + * @return array */ public function collect(): array { @@ -83,7 +82,7 @@ class TelemetryCollectionService ]; })->filter(fn (?array $node): bool => $node !== null)->all(); - $payload = [ + return [ 'id' => $uuid, 'panel' => [ @@ -152,8 +151,5 @@ class TelemetryCollectionService 'nodes' => $nodes, ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } } diff --git a/app/Support/JsonValueGuard.php b/app/Support/JsonValueGuard.php index 60dd1f6a0..a86382448 100644 --- a/app/Support/JsonValueGuard.php +++ b/app/Support/JsonValueGuard.php @@ -8,10 +8,7 @@ use UnexpectedValueException; final class JsonValueGuard { - /** - * @return JsonValue - */ - public static function decode(string $encoded, int $maximumDepth = 10): bool|float|int|string|array|null + public static function decode(string $encoded, int $maximumDepth = 10): mixed { $value = json_decode($encoded, true, flags: JSON_THROW_ON_ERROR); self::assertValue($value, $maximumDepth); @@ -19,8 +16,7 @@ final class JsonValueGuard return $value; } - /** @return ApiValue8 */ - public static function decode8(string $encoded): bool|float|int|string|array|null + public static function decode8(string $encoded): mixed { $value = json_decode($encoded, true, flags: JSON_THROW_ON_ERROR); self::assertValue8($value); @@ -28,7 +24,7 @@ final class JsonValueGuard return $value; } - /** @return array */ + /** @return array */ public static function decodeArray8(string $encoded): array { $value = self::decode8($encoded); @@ -37,9 +33,6 @@ final class JsonValueGuard return $value; } - /** - * @phpstan-assert JsonValue $value - */ public static function assertValue(mixed $value, int $remainingDepth = 10): void { if ($value === null || is_bool($value) || is_float($value) || is_int($value) || is_string($value)) { @@ -57,7 +50,7 @@ final class JsonValueGuard } } - /** @phpstan-assert ApiPayload $value */ + /** @phpstan-assert array $value */ public static function assertPayload(mixed $value): void { self::assertValue($value); @@ -68,7 +61,7 @@ final class JsonValueGuard } } - /** @phpstan-assert ApiScalar $value */ + /** @phpstan-assert bool|float|int|string|null $value */ public static function assertScalar(mixed $value): void { throw_if($value !== null && ! is_bool($value) && ! is_float($value) && ! is_int($value) && ! is_string($value), UnexpectedValueException::class, 'Expected a scalar JSON value.'); @@ -83,9 +76,9 @@ final class JsonValueGuard } /** - * @phpstan-assert array $value + * @phpstan-assert array $value * - * @return array + * @return array */ public static function jsonArray(mixed $value): array { @@ -111,7 +104,7 @@ final class JsonValueGuard return $value; } - /** @phpstan-assert array $value */ + /** @phpstan-assert array $value */ public static function assertScalarPayload(mixed $value): void { throw_unless(is_array($value), UnexpectedValueException::class, 'Expected a scalar payload.'); @@ -123,7 +116,7 @@ final class JsonValueGuard } } - /** @phpstan-assert array $value */ + /** @phpstan-assert array $value */ public static function assertPayload9(mixed $value): void { self::assertValue($value, 9); @@ -134,7 +127,6 @@ final class JsonValueGuard } } - /** @phpstan-assert ApiValue8 $value */ private static function assertValue8(mixed $value): void { self::assertValue($value, 8); diff --git a/app/Support/JsonValueTree.php b/app/Support/JsonValueTree.php deleted file mode 100644 index 0b1ecf7ea..000000000 --- a/app/Support/JsonValueTree.php +++ /dev/null @@ -1,77 +0,0 @@ - $value */ - private function __construct(private bool|float|int|string|array|JsonEmptyObject|null $value) {} - - /** @param JsonInputValue $value */ - public static function from(mixed $value): self - { - if (! is_array($value)) { - return new self($value); - } - - $children = []; - foreach ($value as $key => $child) { - $children[$key] = self::from($child); - } - - return new self($children); - } - - /** @param Closure(string): string $mapper */ - public function mapStrings(Closure $mapper): self - { - if (is_string($this->value)) { - return new self($mapper($this->value)); - } - - if (! is_array($this->value)) { - return $this; - } - - $children = []; - foreach ($this->value as $key => $child) { - $children[$key] = $child->mapStrings($mapper); - } - - return new self($children); - } - - public function arraySize(): ?int - { - return is_array($this->value) ? count($this->value) : null; - } - - /** @return JsonValue */ - public function toValue(): bool|float|int|string|array|null - { - return JsonValueGuard::decode(json_encode($this, JSON_THROW_ON_ERROR)); - } - - /** @return ApiValue8 */ - public function toValue8(): bool|float|int|string|array|null - { - return JsonValueGuard::decode8(json_encode($this, JSON_THROW_ON_ERROR)); - } - - /** @return array */ - public function toArray8(): array - { - return JsonValueGuard::decodeArray8(json_encode($this, JSON_THROW_ON_ERROR)); - } - - /** @return ApiScalar|JsonEmptyObject|array */ - public function jsonSerialize(): bool|float|int|string|array|JsonEmptyObject|null - { - return $this->value; - } -} diff --git a/app/Transformers/Api/Admin/AllocationTransformer.php b/app/Transformers/Api/Admin/AllocationTransformer.php index 830bba45b..6ae09bbeb 100644 --- a/app/Transformers/Api/Admin/AllocationTransformer.php +++ b/app/Transformers/Api/Admin/AllocationTransformer.php @@ -30,7 +30,7 @@ class AllocationTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Allocation $allocation): array { diff --git a/app/Transformers/Api/Admin/ApiKeyTransformer.php b/app/Transformers/Api/Admin/ApiKeyTransformer.php index 6d4fb117d..faf917c0f 100644 --- a/app/Transformers/Api/Admin/ApiKeyTransformer.php +++ b/app/Transformers/Api/Admin/ApiKeyTransformer.php @@ -19,7 +19,7 @@ class ApiKeyTransformer extends BaseAdminTransformer /** Never exposes the token; the plaintext secret is only returned once on create. */ /** - * @return ApiPayload + * @return array */ public function transform(ApiKey $model): array { diff --git a/app/Transformers/Api/Admin/BackupTransformer.php b/app/Transformers/Api/Admin/BackupTransformer.php index dbb055b6b..f496f6059 100644 --- a/app/Transformers/Api/Admin/BackupTransformer.php +++ b/app/Transformers/Api/Admin/BackupTransformer.php @@ -17,7 +17,7 @@ class BackupTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Backup $backup): array { diff --git a/app/Transformers/Api/Admin/DatabaseHostTransformer.php b/app/Transformers/Api/Admin/DatabaseHostTransformer.php index 422b1a592..62fb1422c 100644 --- a/app/Transformers/Api/Admin/DatabaseHostTransformer.php +++ b/app/Transformers/Api/Admin/DatabaseHostTransformer.php @@ -11,7 +11,6 @@ use Pterodactyl\Extensions\Scribe\Attributes\ResponseField; use Pterodactyl\Models\Database; use Pterodactyl\Models\DatabaseHost; use Pterodactyl\Models\Server; -use Pterodactyl\Support\JsonValueGuard; use UnexpectedValueException; #[ResponseField('max_databases', 'integer', example: 50, nullable: true)] @@ -37,11 +36,11 @@ class DatabaseHostTransformer extends BaseAdminTransformer /** The host password is never exposed through the API surface. */ /** - * @return ApiPayload + * @return array */ public function transform(DatabaseHost $model): array { - $payload = [ + return [ 'id' => $model->id, 'name' => $model->name, 'host' => $model->host, @@ -55,9 +54,6 @@ class DatabaseHostTransformer extends BaseAdminTransformer 'updated_at' => $this->formatTimestamp($model->updated_at), ...$this->extensionFields($model), ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } public function includeNode(DatabaseHost $model): Item|NullResource diff --git a/app/Transformers/Api/Admin/EggTransformer.php b/app/Transformers/Api/Admin/EggTransformer.php index 80605fc96..590e6802b 100644 --- a/app/Transformers/Api/Admin/EggTransformer.php +++ b/app/Transformers/Api/Admin/EggTransformer.php @@ -43,11 +43,11 @@ class EggTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Egg $model): array { - $payload = [ + return [ 'id' => $model->id, 'uuid' => $model->uuid, 'author' => $model->author, @@ -79,9 +79,6 @@ class EggTransformer extends BaseAdminTransformer $model->getUpdatedAtColumn() => $this->formatTimestamp($model->updated_at), ...$this->extensionFields($model), ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } public function includeVariables(Egg $model): Collection|NullResource @@ -121,10 +118,8 @@ class EggTransformer extends BaseAdminTransformer * A configuration column exactly as stored. Null means the egg inherits the value from the * egg it copies configuration from, while "{}" means it has none, so neither may turn into * the other on the way to the editor and back. - * - * @return JsonValue|JsonEmptyObject */ - private function configuration(?string $encoded): bool|float|int|string|array|JsonEmptyObject|null + private function configuration(?string $encoded): mixed { if ($encoded === null) { return null; diff --git a/app/Transformers/Api/Admin/EggVariableTransformer.php b/app/Transformers/Api/Admin/EggVariableTransformer.php index 9ff11f01d..3d4e6057c 100644 --- a/app/Transformers/Api/Admin/EggVariableTransformer.php +++ b/app/Transformers/Api/Admin/EggVariableTransformer.php @@ -16,7 +16,7 @@ class EggVariableTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(EggVariable $model): array { diff --git a/app/Transformers/Api/Admin/LocationTransformer.php b/app/Transformers/Api/Admin/LocationTransformer.php index b1ce729af..d17f51546 100644 --- a/app/Transformers/Api/Admin/LocationTransformer.php +++ b/app/Transformers/Api/Admin/LocationTransformer.php @@ -7,7 +7,6 @@ namespace Pterodactyl\Transformers\Api\Admin; use League\Fractal\Resource\Collection; use League\Fractal\Resource\NullResource; use Pterodactyl\Models\Location; -use Pterodactyl\Support\JsonValueGuard; class LocationTransformer extends BaseAdminTransformer { @@ -29,11 +28,11 @@ class LocationTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Location $location): array { - $payload = [ + return [ 'id' => $location->id, 'short' => $location->short, 'long' => $location->long, @@ -43,9 +42,6 @@ class LocationTransformer extends BaseAdminTransformer 'updated_at' => $this->formatTimestamp($location->updated_at), ...$this->extensionFields($location), ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } public function includeNodes(Location $location): Collection|NullResource diff --git a/app/Transformers/Api/Admin/MountTransformer.php b/app/Transformers/Api/Admin/MountTransformer.php index 02a1cc9fe..ab3fdb597 100644 --- a/app/Transformers/Api/Admin/MountTransformer.php +++ b/app/Transformers/Api/Admin/MountTransformer.php @@ -8,7 +8,6 @@ use League\Fractal\Resource\Collection; use League\Fractal\Resource\NullResource; use Pterodactyl\Extensions\Scribe\Attributes\ResponseField; use Pterodactyl\Models\Mount; -use Pterodactyl\Support\JsonValueGuard; #[ResponseField('description', nullable: true)] #[ResponseField('mounted', 'boolean', 'Present only when listed in the context of a server.', required: false, nullable: true)] @@ -36,11 +35,11 @@ class MountTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Mount $mount): array { - $payload = [ + return [ 'id' => $mount->id, 'uuid' => $mount->uuid, 'name' => $mount->name, @@ -54,9 +53,6 @@ class MountTransformer extends BaseAdminTransformer 'servers_count' => (int) ($mount->servers_count ?? 0), ...$this->extensionFields($mount), ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } public function includeEggs(Mount $mount): Collection|NullResource diff --git a/app/Transformers/Api/Admin/NodeTransformer.php b/app/Transformers/Api/Admin/NodeTransformer.php index f36260761..59e8f0c04 100644 --- a/app/Transformers/Api/Admin/NodeTransformer.php +++ b/app/Transformers/Api/Admin/NodeTransformer.php @@ -10,7 +10,6 @@ use League\Fractal\Resource\Item; use League\Fractal\Resource\NullResource; use Pterodactyl\Extensions\Scribe\Attributes\ResponseField; use Pterodactyl\Models\Node; -use Pterodactyl\Support\JsonValueGuard; #[ResponseField('servers_count', 'integer', 'Present when the endpoint loads server counts.', required: false, example: 0)] class NodeTransformer extends BaseAdminTransformer @@ -34,12 +33,11 @@ class NodeTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Node $node): array { $attributes = $node->attributesToArray(); - JsonValueGuard::assertValue($attributes); $response = []; foreach ($attributes as $key => $value) { @@ -55,11 +53,8 @@ class NodeTransformer extends BaseAdminTransformer unset($response['sum_memory'], $response['sum_disk']); $response['allocated_resources'] = $node->allocatedResources(); $response['relationships'] = []; - $response = [...$response, ...$this->extensionFields($node)]; - JsonValueGuard::assertPayload($response); - - return $response; + return [...$response, ...$this->extensionFields($node)]; } public function includeAllocations(Node $node): Collection|NullResource diff --git a/app/Transformers/Api/Admin/ServerDatabaseTransformer.php b/app/Transformers/Api/Admin/ServerDatabaseTransformer.php index 0a9f1bc10..a202fdc35 100644 --- a/app/Transformers/Api/Admin/ServerDatabaseTransformer.php +++ b/app/Transformers/Api/Admin/ServerDatabaseTransformer.php @@ -26,7 +26,7 @@ class ServerDatabaseTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Database $model): array { diff --git a/app/Transformers/Api/Admin/ServerTransferTransformer.php b/app/Transformers/Api/Admin/ServerTransferTransformer.php index 5f91b889e..c6956fc8f 100644 --- a/app/Transformers/Api/Admin/ServerTransferTransformer.php +++ b/app/Transformers/Api/Admin/ServerTransferTransformer.php @@ -14,7 +14,7 @@ class ServerTransferTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(ServerTransfer $model): array { diff --git a/app/Transformers/Api/Admin/ServerTransformer.php b/app/Transformers/Api/Admin/ServerTransformer.php index 3f0d756e3..e221b3f18 100644 --- a/app/Transformers/Api/Admin/ServerTransformer.php +++ b/app/Transformers/Api/Admin/ServerTransformer.php @@ -11,7 +11,6 @@ use Pterodactyl\Extensions\Scribe\Attributes\ResponseField; use Pterodactyl\Models\Allocation; use Pterodactyl\Models\Server; use Pterodactyl\Services\Servers\EnvironmentService; -use Pterodactyl\Support\JsonValueGuard; #[ResponseField('external_id', nullable: true)] #[ResponseField('description', nullable: true)] @@ -57,11 +56,11 @@ class ServerTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Server $server): array { - $payload = [ + return [ 'id' => $server->getKey(), 'external_id' => $server->external_id, 'uuid' => $server->uuid, @@ -102,9 +101,6 @@ class ServerTransformer extends BaseAdminTransformer $server->getCreatedAtColumn() => $this->formatTimestamp($server->created_at), ...$this->extensionFields($server), ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } public function includeAllocation(Server $server): Item|NullResource diff --git a/app/Transformers/Api/Admin/ServerVariableTransformer.php b/app/Transformers/Api/Admin/ServerVariableTransformer.php index ba6d8c9e9..16c43a258 100644 --- a/app/Transformers/Api/Admin/ServerVariableTransformer.php +++ b/app/Transformers/Api/Admin/ServerVariableTransformer.php @@ -6,7 +6,6 @@ namespace Pterodactyl\Transformers\Api\Admin; use Pterodactyl\Models\EggVariable; use Pterodactyl\Models\ServerVariable; -use Pterodactyl\Support\JsonValueGuard; class ServerVariableTransformer extends BaseAdminTransformer { @@ -17,13 +16,10 @@ class ServerVariableTransformer extends BaseAdminTransformer /** The server variables relation resolves to EggVariable models carrying the server-specific value. */ /** - * @return ApiPayload + * @return array */ public function transform(EggVariable $variable): array { - $attributes = $variable->attributesToArray(); - JsonValueGuard::assertPayload($attributes); - - return $attributes; + return $variable->attributesToArray(); } } diff --git a/app/Transformers/Api/Admin/SubuserTransformer.php b/app/Transformers/Api/Admin/SubuserTransformer.php index f5f252b35..41d1d227a 100644 --- a/app/Transformers/Api/Admin/SubuserTransformer.php +++ b/app/Transformers/Api/Admin/SubuserTransformer.php @@ -14,7 +14,7 @@ class SubuserTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Subuser $subuser): array { diff --git a/app/Transformers/Api/Admin/TagTransformer.php b/app/Transformers/Api/Admin/TagTransformer.php index 561ea36b6..dd6d9f25b 100644 --- a/app/Transformers/Api/Admin/TagTransformer.php +++ b/app/Transformers/Api/Admin/TagTransformer.php @@ -35,7 +35,7 @@ class TagTransformer extends BaseAdminTransformer * label and colour owned by the EggSpecificTags enum rather than whatever is * stored, so a client never has to know that distinction to render a tag. * - * @return ApiPayload + * @return array */ public function transform(Tag $model): array { diff --git a/app/Transformers/Api/Admin/UserTransformer.php b/app/Transformers/Api/Admin/UserTransformer.php index ced6a98a8..30381693e 100644 --- a/app/Transformers/Api/Admin/UserTransformer.php +++ b/app/Transformers/Api/Admin/UserTransformer.php @@ -8,7 +8,6 @@ use Illuminate\Support\Str; use League\Fractal\Resource\Collection; use League\Fractal\Resource\NullResource; use Pterodactyl\Models\User; -use Pterodactyl\Support\JsonValueGuard; class UserTransformer extends BaseAdminTransformer { @@ -28,11 +27,11 @@ class UserTransformer extends BaseAdminTransformer } /** - * @return ApiPayload + * @return array */ public function transform(User $user): array { - $payload = [ + return [ 'id' => $user->id, 'external_id' => $user->external_id, 'uuid' => $user->uuid, @@ -51,9 +50,6 @@ class UserTransformer extends BaseAdminTransformer 'relationships' => [], ...$this->extensionFields($user), ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } public function includeServers(User $user): Collection|NullResource diff --git a/app/Transformers/Api/Application/AllocationTransformer.php b/app/Transformers/Api/Application/AllocationTransformer.php index 98525e6a2..1047abc2b 100644 --- a/app/Transformers/Api/Application/AllocationTransformer.php +++ b/app/Transformers/Api/Application/AllocationTransformer.php @@ -37,7 +37,7 @@ class AllocationTransformer extends BaseTransformer /** * Return a generic transformed allocation array. * - * @return ApiPayload + * @return array */ public function transform(Allocation $allocation): array { diff --git a/app/Transformers/Api/Application/DatabaseHostTransformer.php b/app/Transformers/Api/Application/DatabaseHostTransformer.php index da2b31062..68babf9a9 100644 --- a/app/Transformers/Api/Application/DatabaseHostTransformer.php +++ b/app/Transformers/Api/Application/DatabaseHostTransformer.php @@ -35,7 +35,7 @@ class DatabaseHostTransformer extends BaseTransformer /** * Transform database host into a representation for the application API. * - * @return ApiPayload + * @return array */ public function transform(DatabaseHost $model): array { diff --git a/app/Transformers/Api/Application/EggTransformer.php b/app/Transformers/Api/Application/EggTransformer.php index 6ddebdd36..e10d9ef11 100644 --- a/app/Transformers/Api/Application/EggTransformer.php +++ b/app/Transformers/Api/Application/EggTransformer.php @@ -17,7 +17,6 @@ use Pterodactyl\Models\Server; use Pterodactyl\Models\Tag; use Pterodactyl\Services\Acl\Api\AdminAcl; use Pterodactyl\Support\JsonEmptyObject; -use Pterodactyl\Support\JsonValueGuard; #[ResponseField('description', nullable: true)] #[ResponseField('docker_images', schema: ['type' => 'object', 'additionalProperties' => ['type' => 'string'], 'example' => ['Java 23' => 'ghcr.io/pterodactyl/yolks:java_23']])] @@ -61,7 +60,7 @@ class EggTransformer extends BaseTransformer * Transform an Egg model into a representation that can be consumed by * the application api. * - * @return ApiPayload + * @return array * * @throws JsonException */ @@ -72,7 +71,7 @@ class EggTransformer extends BaseTransformer $files = new JsonEmptyObject; } - $payload = [ + return [ 'id' => $model->id, 'uuid' => $model->uuid, 'name' => $model->name, @@ -103,9 +102,6 @@ class EggTransformer extends BaseTransformer $model->getCreatedAtColumn() => $this->formatTimestamp($model->created_at), $model->getUpdatedAtColumn() => $this->formatTimestamp($model->updated_at), ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } /** diff --git a/app/Transformers/Api/Application/EggVariableTransformer.php b/app/Transformers/Api/Application/EggVariableTransformer.php index 13b1095ea..cf58bb067 100644 --- a/app/Transformers/Api/Application/EggVariableTransformer.php +++ b/app/Transformers/Api/Application/EggVariableTransformer.php @@ -6,7 +6,6 @@ namespace Pterodactyl\Transformers\Api\Application; use Pterodactyl\Models\Egg; use Pterodactyl\Models\EggVariable; -use Pterodactyl\Support\JsonValueGuard; class EggVariableTransformer extends BaseTransformer { @@ -19,13 +18,10 @@ class EggVariableTransformer extends BaseTransformer } /** - * @return ApiPayload + * @return array */ public function transform(EggVariable $model): array { - $attributes = $model->attributesToArray(); - JsonValueGuard::assertPayload($attributes); - - return $attributes; + return $model->attributesToArray(); } } diff --git a/app/Transformers/Api/Application/LocationTransformer.php b/app/Transformers/Api/Application/LocationTransformer.php index 5e59d70a3..7b5756481 100644 --- a/app/Transformers/Api/Application/LocationTransformer.php +++ b/app/Transformers/Api/Application/LocationTransformer.php @@ -9,7 +9,6 @@ use League\Fractal\Resource\NullResource; use Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException; use Pterodactyl\Models\Location; use Pterodactyl\Services\Acl\Api\AdminAcl; -use Pterodactyl\Support\JsonValueGuard; class LocationTransformer extends BaseTransformer { @@ -36,11 +35,11 @@ class LocationTransformer extends BaseTransformer /** * Return a generic transformed location array. * - * @return ApiPayload + * @return array */ public function transform(Location $location): array { - $payload = [ + return [ 'id' => $location->id, 'short' => $location->short, 'long' => $location->long, @@ -49,9 +48,6 @@ class LocationTransformer extends BaseTransformer $location->getCreatedAtColumn() => $this->formatTimestamp($location->created_at), ...$this->extensionFields($location), ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } /** diff --git a/app/Transformers/Api/Application/NodeTransformer.php b/app/Transformers/Api/Application/NodeTransformer.php index 8b91b93dd..0cf519e75 100644 --- a/app/Transformers/Api/Application/NodeTransformer.php +++ b/app/Transformers/Api/Application/NodeTransformer.php @@ -11,7 +11,6 @@ use League\Fractal\Resource\NullResource; use Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException; use Pterodactyl\Models\Node; use Pterodactyl\Services\Acl\Api\AdminAcl; -use Pterodactyl\Support\JsonValueGuard; class NodeTransformer extends BaseTransformer { @@ -42,12 +41,11 @@ class NodeTransformer extends BaseTransformer * Return a node transformed into a format that can be consumed by the * external administrative API. * - * @return ApiPayload + * @return array */ public function transform(Node $node): array { $attributes = $node->attributesToArray(); - JsonValueGuard::assertValue($attributes); $response = []; foreach ($attributes as $key => $value) { @@ -64,11 +62,8 @@ class NodeTransformer extends BaseTransformer unset($response['sum_memory'], $response['sum_disk']); $response['allocated_resources'] = $node->allocatedResources(); $response['relationships'] = []; - $response = [...$response, ...$this->extensionFields($node)]; - JsonValueGuard::assertPayload($response); - - return $response; + return [...$response, ...$this->extensionFields($node)]; } /** diff --git a/app/Transformers/Api/Application/ServerDatabaseTransformer.php b/app/Transformers/Api/Application/ServerDatabaseTransformer.php index c5361bfc1..e14cb9e34 100644 --- a/app/Transformers/Api/Application/ServerDatabaseTransformer.php +++ b/app/Transformers/Api/Application/ServerDatabaseTransformer.php @@ -36,7 +36,7 @@ class ServerDatabaseTransformer extends BaseTransformer /** * Transform a database model in a representation for the application API. * - * @return ApiPayload + * @return array */ public function transform(Database $model): array { diff --git a/app/Transformers/Api/Application/ServerTransferTransformer.php b/app/Transformers/Api/Application/ServerTransferTransformer.php index dc3d09809..c9da54ef1 100644 --- a/app/Transformers/Api/Application/ServerTransferTransformer.php +++ b/app/Transformers/Api/Application/ServerTransferTransformer.php @@ -14,7 +14,7 @@ class ServerTransferTransformer extends BaseTransformer } /** - * @return ApiPayload + * @return array */ public function transform(ServerTransfer $model): array { diff --git a/app/Transformers/Api/Application/ServerTransformer.php b/app/Transformers/Api/Application/ServerTransformer.php index 5b584537d..87f3314e2 100644 --- a/app/Transformers/Api/Application/ServerTransformer.php +++ b/app/Transformers/Api/Application/ServerTransformer.php @@ -12,7 +12,6 @@ use Pterodactyl\Extensions\Scribe\Attributes\ResponseField; use Pterodactyl\Models\Server; use Pterodactyl\Services\Acl\Api\AdminAcl; use Pterodactyl\Services\Servers\EnvironmentService; -use Pterodactyl\Support\JsonValueGuard; #[ResponseField('description', nullable: true)] #[ResponseField('feature_limits.databases', 'integer', example: 0, nullable: true)] @@ -64,11 +63,11 @@ class ServerTransformer extends BaseTransformer /** * Return a generic transformed server array. * - * @return ApiPayload + * @return array */ public function transform(Server $server): array { - $payload = [ + return [ 'id' => $server->getKey(), 'external_id' => $server->external_id, 'uuid' => $server->uuid, @@ -109,9 +108,6 @@ class ServerTransformer extends BaseTransformer $server->getCreatedAtColumn() => $this->formatTimestamp($server->created_at), ...$this->extensionFields($server), ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } /** diff --git a/app/Transformers/Api/Application/ServerVariableTransformer.php b/app/Transformers/Api/Application/ServerVariableTransformer.php index 16377af66..c10bd1a87 100644 --- a/app/Transformers/Api/Application/ServerVariableTransformer.php +++ b/app/Transformers/Api/Application/ServerVariableTransformer.php @@ -10,7 +10,6 @@ use Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException; use Pterodactyl\Models\EggVariable; use Pterodactyl\Models\ServerVariable; use Pterodactyl\Services\Acl\Api\AdminAcl; -use Pterodactyl\Support\JsonValueGuard; class ServerVariableTransformer extends BaseTransformer { @@ -32,14 +31,11 @@ class ServerVariableTransformer extends BaseTransformer /** * Return a generic transformed server variable array. * - * @return ApiPayload + * @return array */ public function transform(EggVariable $variable): array { - $attributes = $variable->attributesToArray(); - JsonValueGuard::assertPayload($attributes); - - return $attributes; + return $variable->attributesToArray(); } /** diff --git a/app/Transformers/Api/Application/SubuserTransformer.php b/app/Transformers/Api/Application/SubuserTransformer.php index bb7b7cd2f..bae6ced7b 100644 --- a/app/Transformers/Api/Application/SubuserTransformer.php +++ b/app/Transformers/Api/Application/SubuserTransformer.php @@ -35,7 +35,7 @@ class SubuserTransformer extends BaseTransformer /** * Return a transformed Subuser model that can be consumed by external services. * - * @return ApiPayload + * @return array */ public function transform(Subuser $subuser): array { diff --git a/app/Transformers/Api/Application/TagTransformer.php b/app/Transformers/Api/Application/TagTransformer.php index c8a56e272..fa3fd732c 100644 --- a/app/Transformers/Api/Application/TagTransformer.php +++ b/app/Transformers/Api/Application/TagTransformer.php @@ -41,7 +41,7 @@ class TagTransformer extends BaseTransformer * Transform a tag into its application API representation. Built-in game tags * report the name and colour that the Panel assigns them. * - * @return ApiPayload + * @return array */ public function transform(Tag $model): array { diff --git a/app/Transformers/Api/Application/UserTransformer.php b/app/Transformers/Api/Application/UserTransformer.php index c5f553d9d..946b15aed 100644 --- a/app/Transformers/Api/Application/UserTransformer.php +++ b/app/Transformers/Api/Application/UserTransformer.php @@ -9,7 +9,6 @@ use League\Fractal\Resource\NullResource; use Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException; use Pterodactyl\Models\User; use Pterodactyl\Services\Acl\Api\AdminAcl; -use Pterodactyl\Support\JsonValueGuard; class UserTransformer extends BaseTransformer { @@ -35,11 +34,11 @@ class UserTransformer extends BaseTransformer /** * Return a transformed User model that can be consumed by external services. * - * @return ApiPayload + * @return array */ public function transform(User $user): array { - $payload = [ + return [ 'id' => $user->id, 'external_id' => $user->external_id, 'uuid' => $user->uuid, @@ -55,9 +54,6 @@ class UserTransformer extends BaseTransformer 'updated_at' => $this->formatTimestamp($user->updated_at), ...$this->extensionFields($user), ]; - JsonValueGuard::assertPayload($payload); - - return $payload; } /** diff --git a/app/Transformers/Api/Client/AccountTransformer.php b/app/Transformers/Api/Client/AccountTransformer.php index e609b2def..d6c61510c 100644 --- a/app/Transformers/Api/Client/AccountTransformer.php +++ b/app/Transformers/Api/Client/AccountTransformer.php @@ -19,7 +19,7 @@ class AccountTransformer extends BaseClientTransformer /** * Return basic information about the currently logged-in user. * - * @return ApiPayload + * @return array */ public function transform(User $model): array { diff --git a/app/Transformers/Api/Client/AllocationTransformer.php b/app/Transformers/Api/Client/AllocationTransformer.php index be192b694..50746f567 100644 --- a/app/Transformers/Api/Client/AllocationTransformer.php +++ b/app/Transformers/Api/Client/AllocationTransformer.php @@ -22,7 +22,7 @@ class AllocationTransformer extends BaseClientTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Allocation $model): array { diff --git a/app/Transformers/Api/Client/ApiKeyTransformer.php b/app/Transformers/Api/Client/ApiKeyTransformer.php index c6f4cef6b..d99b61d49 100644 --- a/app/Transformers/Api/Client/ApiKeyTransformer.php +++ b/app/Transformers/Api/Client/ApiKeyTransformer.php @@ -18,7 +18,7 @@ class ApiKeyTransformer extends BaseClientTransformer /** * Transform this model into a representation that can be consumed by a client. * - * @return ApiPayload + * @return array */ public function transform(ApiKey $model): array { diff --git a/app/Transformers/Api/Client/BackupTransformer.php b/app/Transformers/Api/Client/BackupTransformer.php index a36478a41..de389b8ba 100644 --- a/app/Transformers/Api/Client/BackupTransformer.php +++ b/app/Transformers/Api/Client/BackupTransformer.php @@ -17,7 +17,7 @@ class BackupTransformer extends BaseClientTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Backup $backup): array { diff --git a/app/Transformers/Api/Client/DatabaseTransformer.php b/app/Transformers/Api/Client/DatabaseTransformer.php index cb0616d9b..3596f3f9b 100644 --- a/app/Transformers/Api/Client/DatabaseTransformer.php +++ b/app/Transformers/Api/Client/DatabaseTransformer.php @@ -28,7 +28,7 @@ class DatabaseTransformer extends BaseClientTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Database $model): array { diff --git a/app/Transformers/Api/Client/EggTransformer.php b/app/Transformers/Api/Client/EggTransformer.php index 95a3d53f0..5199aa21f 100644 --- a/app/Transformers/Api/Client/EggTransformer.php +++ b/app/Transformers/Api/Client/EggTransformer.php @@ -17,7 +17,7 @@ class EggTransformer extends BaseClientTransformer } /** - * @return ApiPayload + * @return array */ public function transform(Egg $egg): array { diff --git a/app/Transformers/Api/Client/EggVariableTransformer.php b/app/Transformers/Api/Client/EggVariableTransformer.php index fd0c0c288..a82bd2a55 100644 --- a/app/Transformers/Api/Client/EggVariableTransformer.php +++ b/app/Transformers/Api/Client/EggVariableTransformer.php @@ -15,7 +15,7 @@ class EggVariableTransformer extends BaseClientTransformer } /** - * @return ApiPayload + * @return array */ public function transform(EggVariable $variable): array { diff --git a/app/Transformers/Api/Client/FileObjectTransformer.php b/app/Transformers/Api/Client/FileObjectTransformer.php index 4f65f1df9..fcc8bfa19 100644 --- a/app/Transformers/Api/Client/FileObjectTransformer.php +++ b/app/Transformers/Api/Client/FileObjectTransformer.php @@ -12,7 +12,7 @@ class FileObjectTransformer extends BaseClientTransformer * Transform a file object response from the daemon into a standardized response. * * @param DaemonFileObject $item - * @return ApiPayload + * @return array */ public function transform(array $item): array { diff --git a/app/Transformers/Api/Client/ScheduleTransformer.php b/app/Transformers/Api/Client/ScheduleTransformer.php index 90daf2491..db5a4b53f 100644 --- a/app/Transformers/Api/Client/ScheduleTransformer.php +++ b/app/Transformers/Api/Client/ScheduleTransformer.php @@ -35,7 +35,7 @@ class ScheduleTransformer extends BaseClientTransformer /** * Returns a transformed schedule model such that a client can view the information. * - * @return ApiPayload + * @return array */ public function transform(Schedule $model): array { diff --git a/app/Transformers/Api/Client/ServerTransformer.php b/app/Transformers/Api/Client/ServerTransformer.php index ac1babefd..41ba7fbf4 100644 --- a/app/Transformers/Api/Client/ServerTransformer.php +++ b/app/Transformers/Api/Client/ServerTransformer.php @@ -62,7 +62,7 @@ class ServerTransformer extends BaseClientTransformer * Transform a server model into a representation that can be returned * to a client. * - * @return ApiPayload + * @return array */ public function transform(Server $server): array { diff --git a/app/Transformers/Api/Client/StatsTransformer.php b/app/Transformers/Api/Client/StatsTransformer.php index 3f1a0c919..ec287b990 100644 --- a/app/Transformers/Api/Client/StatsTransformer.php +++ b/app/Transformers/Api/Client/StatsTransformer.php @@ -17,7 +17,7 @@ class StatsTransformer extends BaseClientTransformer * Transform the live state of a server into a result set that can be used * in the client API. * - * @return ApiPayload + * @return array */ public function transform(ServerState $state): array { diff --git a/app/Transformers/Api/Client/SubuserTransformer.php b/app/Transformers/Api/Client/SubuserTransformer.php index e3b01cc70..6703b7c3b 100644 --- a/app/Transformers/Api/Client/SubuserTransformer.php +++ b/app/Transformers/Api/Client/SubuserTransformer.php @@ -24,7 +24,7 @@ class SubuserTransformer extends BaseClientTransformer /** * Transforms a subuser into a model that can be shown to a front-end user. * - * @return ApiPayload + * @return array * * @throws InvalidTransformerLevelException */ diff --git a/app/Transformers/Api/Client/TaskTransformer.php b/app/Transformers/Api/Client/TaskTransformer.php index 02c0a316f..eabf93d72 100644 --- a/app/Transformers/Api/Client/TaskTransformer.php +++ b/app/Transformers/Api/Client/TaskTransformer.php @@ -18,7 +18,7 @@ class TaskTransformer extends BaseClientTransformer /** * Transforms a schedule's task into a client viewable format. * - * @return ApiPayload + * @return array */ public function transform(Task $model): array { diff --git a/app/Transformers/Api/Client/UserSSHKeyTransformer.php b/app/Transformers/Api/Client/UserSSHKeyTransformer.php index 96112a596..515ff5ab8 100644 --- a/app/Transformers/Api/Client/UserSSHKeyTransformer.php +++ b/app/Transformers/Api/Client/UserSSHKeyTransformer.php @@ -16,7 +16,7 @@ class UserSSHKeyTransformer extends BaseClientTransformer /** * Return's a user's SSH key in an API response format. * - * @return ApiPayload + * @return array */ public function transform(UserSSHKey $model): array { diff --git a/app/Transformers/Api/Client/UserTransformer.php b/app/Transformers/Api/Client/UserTransformer.php index a722bc8e1..d9de2b283 100644 --- a/app/Transformers/Api/Client/UserTransformer.php +++ b/app/Transformers/Api/Client/UserTransformer.php @@ -21,7 +21,7 @@ class UserTransformer extends BaseClientTransformer * Transforms a User model into a representation that can be shown to regular * users of the API. * - * @return ApiPayload + * @return array */ public function transform(User $model): array { diff --git a/app/Transformers/Concerns/FormatsActivityLogs.php b/app/Transformers/Concerns/FormatsActivityLogs.php index d13661de4..84a1824d9 100644 --- a/app/Transformers/Concerns/FormatsActivityLogs.php +++ b/app/Transformers/Concerns/FormatsActivityLogs.php @@ -6,8 +6,6 @@ namespace Pterodactyl\Transformers\Concerns; use Illuminate\Support\Str; use Pterodactyl\Models\ActivityLog; -use Pterodactyl\Support\JsonValueGuard; -use Pterodactyl\Support\JsonValueTree; use stdClass; trait FormatsActivityLogs @@ -45,22 +43,21 @@ trait FormatsActivityLogs } $properties = collect($values) - ->mapWithKeys(function (array|bool|float|int|string|null $value, string $key) use ($canViewIp): array { + ->mapWithKeys(function (mixed $value, string $key) use ($canViewIp): array { if ($key === 'ip' && ! $canViewIp) { return [$key => '[hidden]']; } - $arraySize = JsonValueTree::from($value)->arraySize(); - if ($arraySize === null) { - // Perform some directory normalization at this point. - if ($key === 'directory') { - $value = str_replace('//', '/', '/'.mb_trim(JsonValueGuard::string($value), '/').'/'); - } - - return [$key => $value]; + if (is_array($value)) { + return [$key => $value, "{$key}_count" => count($value)]; } - return [$key => $value, "{$key}_count" => $arraySize]; + // Perform some directory normalization at this point. + if ($key === 'directory' && is_string($value)) { + $value = str_replace('//', '/', '/'.mb_trim($value, '/').'/'); + } + + return [$key => $value]; }); $keys = $properties->keys()->filter(fn (int|string $key): bool => Str::endsWith((string) $key, '_count'))->values(); @@ -71,7 +68,6 @@ trait FormatsActivityLogs } } - // SAFETY: JSON object properties are string-keyed, and object casting preserves those keys for response encoding. return (object) $properties->all(); } @@ -92,7 +88,7 @@ trait FormatsActivityLogs } $str = trans('activity.'.str_replace(':', '.', $model->event)); - preg_match_all('/:(?[\w.-]+\w)(?:[^\w:]?|$)/', JsonValueGuard::string($str), $matches); + preg_match_all('/:(?[\w.-]+\w)(?:[^\w:]?|$)/', is_string($str) ? $str : '', $matches); $exclude = array_merge($matches['key'], ['ip', 'useragent', 'using_sftp']); foreach (array_keys($properties) as $key) { diff --git a/phpstan.neon b/phpstan.neon index 2181281b3..45c6a2b12 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -14,55 +14,32 @@ parameters: ValidationRuleSet: 'array' ValidationRules: 'array' NormalizedValidationRules: 'array' - ApiScalar: 'bool|float|int|string|null' - EnvironmentValue: 'ApiScalar' - ApiValue0: 'ApiScalar|\Pterodactyl\Support\JsonEmptyObject' - ApiValue1: 'ApiScalar|array' - ApiValue2: 'ApiScalar|array' - ApiValue3: 'ApiScalar|array' - ApiValue4: 'ApiScalar|array' - ApiValue5: 'ApiScalar|array' - ApiValue6: 'ApiScalar|array' - ApiValue7: 'ApiScalar|array' - ApiValue8: 'ApiScalar|array' - ApiValue9: 'ApiScalar|array' - ApiValue10: 'ApiScalar|array' - JsonValue: 'ApiValue10' - JsonInputValue: 'ApiValue0|ApiValue1|ApiValue2|ApiValue3|ApiValue4|ApiValue5|ApiValue6|ApiValue7|ApiValue8|ApiValue9|ApiValue10' - ModelAttributeValue: 'JsonInputValue|\DateTimeInterface|\UnitEnum|\Stringable|\Illuminate\Contracts\Support\Arrayable' - ModelAttributes: 'array' + EnvironmentValue: 'bool|float|int|string|null' ApiErrorSource: 'array{line: int, file: string}' - ApiErrorMetadata: 'array' + ApiErrorMetadata: 'array' ApiError: 'array{code: string, status: string, detail: string, source?: ApiErrorSource, meta?: ApiErrorMetadata}' ApiErrorOverride: 'array{code?: string, status?: string, detail?: string, source?: ApiErrorSource, meta?: ApiErrorMetadata}' ApiErrorEnvelope: 'array{errors: list}' ViteManifestEntry: 'array{file: string, integrity?: string, css?: list, cssIntegrity?: array}' ViteManifest: 'array' - JwtClaimValue: 'JsonValue|\DateTimeImmutable' - JwtClaims: 'array' - ValidationData: 'array' - # Input an action validates itself, from a request or from any other caller. - ActionInput: 'array' + JwtClaims: 'array' SoftwareVersionData: 'array{panel?: string, wings?: string, discord?: string, donations?: string}' NodeConfiguration: 'array{debug: bool, uuid: string, token_id: string, token: string, api: array{host: string, port: int, ssl: array{enabled: bool, cert: string, key: string}, upload_limit: int}, system: array{data: string, sftp: array{bind_port: int}}, allowed_mounts: list, remote: string}' - BackupDiskConfig: 'array{}|array{adapter: string, key?: string, secret?: string, token?: string, bucket?: string, prefix?: string, options?: array, ...}' - S3BackupDiskConfig: 'array{adapter: string, bucket: string, key?: string, secret?: string, token?: string, prefix?: string, options?: array, ...}' - EggConfigurationFiles: 'array, ...}>' - EggConfigurationReplacement: 'array{match: array-key, if_value?: array-key, replace_with: ApiValue6}' - EggConfigurationOutput: 'array{file: string, replace: list, ...}' + BackupDiskConfig: 'array{}|array{adapter: string, key?: string, secret?: string, token?: string, bucket?: string, prefix?: string, options?: array, ...}' + S3BackupDiskConfig: 'array{adapter: string, bucket: string, key?: string, secret?: string, token?: string, prefix?: string, options?: array, ...}' + EggConfigurationFiles: 'array, ...}>' + EggConfigurationReplacement: 'array{match: array-key, if_value?: array-key, replace_with: mixed}' + EggConfigurationOutput: 'array{file: string, replace: list, ...}' EggConfigurationOutputs: 'list' - ApiPayload: 'array' - ApiPayload9: 'array' - FractalTransformedPayload: 'array{relationships?: array, ...}' # What an API resource renders: a model, the live state of a server, or a daemon payload. - ApiResourceData: '\Illuminate\Database\Eloquent\Model|\Pterodactyl\Data\ServerState|array' + ApiResourceData: '\Illuminate\Database\Eloquent\Model|\Pterodactyl\Data\ServerState|array' # An API resource's rendered attributes: toArray() with the includes in `relationships`, # held as the resolved resource objects the way Laravel nests resources in toArray(). - ApiResourceAttributes: 'array>' - ApiResourceMeta: 'array' + ApiResourceAttributes: 'array>' + ApiResourceMeta: 'array' ApiResourceItem: 'array{object: string|null, attributes: ApiResourceAttributes, meta?: ApiResourceMeta}' ApiResourcePagination: 'array{total: int, count: int, per_page: int, current_page: int, total_pages: int, links: array{previous?: string, next?: string}|\Pterodactyl\Support\JsonEmptyObject}' - ApiResourceList: 'array{object: string, data: list, meta?: array}' + ApiResourceList: 'array{object: string, data: list, meta?: array}' DaemonFileObject: 'array{name?: string, mode?: string, mode_bits?: string, size?: int, file?: bool, symlink?: bool, mime?: string, created?: string, modified?: string}' DaemonStats: 'array{state?: string, is_suspended?: bool, utilization?: array{memory_bytes?: int, cpu_absolute?: float|int, disk_bytes?: int, network?: array{rx_bytes?: int, tx_bytes?: int}, uptime?: int}}' DatabaseCreationData: 'array{database: string, remote: string, database_host_id: int, max_connections?: int|null}' diff --git a/tests/Integration/Api/Parity/ResourceParity.php b/tests/Integration/Api/Parity/ResourceParity.php index 6e53af88f..acb301dab 100644 --- a/tests/Integration/Api/Parity/ResourceParity.php +++ b/tests/Integration/Api/Parity/ResourceParity.php @@ -195,7 +195,7 @@ final class ResourceParity /** * @param Closure(Request): JsonResponse $respond - * @return array{status: int, body: string, queries: list}>} + * @return array{status: int, body: string, queries: list}>} */ private function render(Closure $respond): array { diff --git a/tests/Support/Fakes/FakeDaemonHttpClient.php b/tests/Support/Fakes/FakeDaemonHttpClient.php index 71990f554..bfe661af7 100644 --- a/tests/Support/Fakes/FakeDaemonHttpClient.php +++ b/tests/Support/Fakes/FakeDaemonHttpClient.php @@ -44,7 +44,7 @@ abstract class FakeDaemonHttpClient $this->calls[] = ['method' => $method, ...$arguments]; } - /** @param string|array $body */ + /** @param string|array $body */ protected function reply(string|array $body = ''): PromiseInterface { if ($this->throwable !== null) { diff --git a/tests/Unit/Http/Resources/Api/ApiResourceTest.php b/tests/Unit/Http/Resources/Api/ApiResourceTest.php index 7a18d48f1..62097ffff 100644 --- a/tests/Unit/Http/Resources/Api/ApiResourceTest.php +++ b/tests/Unit/Http/Resources/Api/ApiResourceTest.php @@ -25,7 +25,7 @@ uses(TestCase::class); * Emits `relationships` between its attributes, includes a callback by default, and * nests itself. * - * @extends ApiResource> + * @extends ApiResource> */ final class TreeResource extends ApiResource { @@ -58,7 +58,7 @@ final class TreeResource extends ApiResource /** * Never emits `relationships`, so includes are appended after its attributes. * - * @extends ApiResource> + * @extends ApiResource> */ final class FlatResource extends ApiResource { @@ -103,7 +103,7 @@ final class LocationFixtureResource extends ApiResource } } -/** @extends ApplicationResource> */ +/** @extends ApplicationResource> */ final class ApplicationFixtureResource extends ApplicationResource { protected array $availableIncludes = ['admin']; @@ -124,7 +124,7 @@ final class ApplicationFixtureResource extends ApplicationResource } } -/** @extends AdminResource> */ +/** @extends AdminResource> */ final class AdminFixtureResource extends AdminResource { public function resourceName(): string @@ -144,7 +144,7 @@ function render(ApiResource|ApiResourceCollection $resource, string $uri = '/'): return json_encode($resource->resolve(Request::create($uri)), JSON_THROW_ON_ERROR); } -/** @return array */ +/** @return array */ function tree(int $id, string $name, array $children = [], ?array $parent = null): array { return ['id' => $id, 'name' => $name, 'children' => $children, ...($parent === null ? [] : ['parent' => $parent])]; diff --git a/tests/Unit/JsonValueTreeTest.php b/tests/Unit/JsonValueTreeTest.php deleted file mode 100644 index beacaab32..000000000 --- a/tests/Unit/JsonValueTreeTest.php +++ /dev/null @@ -1,25 +0,0 @@ - 'run {{PORT}}', 'conditions' => ['{{HOST}}' => '127.0.0.1', 'enabled' => true], 'limit' => 10, 'nullable' => null]; - $tree = JsonValueTree::from($value); - $mapped = $tree->mapStrings(static fn (string $value): string => str_replace(['{{PORT}}', '{{HOST}}'], ['25565', '0.0.0.0'], $value)); - expect($mapped->toValue())->toBe(['command' => 'run 25565', 'conditions' => ['{{HOST}}' => '127.0.0.1', 'enabled' => true], 'limit' => 10, 'nullable' => null]); - // Mapping returns a new tree; the original input is untouched. - expect($tree->toValue())->toBe($value); -}); - -test('counts only the direct children of json arrays', function () { - expect(JsonValueTree::from(['nested' => [1, 2], 'empty' => []])->arraySize())->toBe(2); - expect(JsonValueTree::from([])->arraySize())->toBe(0); - expect(JsonValueTree::from('value')->arraySize())->toBeNull(); - expect(JsonValueTree::from(null)->arraySize())->toBeNull(); -}); diff --git a/tests/Unit/Services/Helpers/SoftwareVersionServiceTest.php b/tests/Unit/Services/Helpers/SoftwareVersionServiceTest.php index ddd6274f1..07186e8b3 100644 --- a/tests/Unit/Services/Helpers/SoftwareVersionServiceTest.php +++ b/tests/Unit/Services/Helpers/SoftwareVersionServiceTest.php @@ -26,7 +26,7 @@ test('ignores version fields with invalid types', function () { expect($service->getPanel())->toBe('error'); expect($service->getDaemon())->toBe('1.12.0'); }); -/** @param array $payload */ +/** @param array $payload */ function service(array $payload): SoftwareVersionService { $cache = new Repository(new ArrayStore); diff --git a/tests/Unit/WingsJsonResponseTest.php b/tests/Unit/WingsJsonResponseTest.php index 922e28e59..9b751ab84 100644 --- a/tests/Unit/WingsJsonResponseTest.php +++ b/tests/Unit/WingsJsonResponseTest.php @@ -14,7 +14,7 @@ use Throwable; uses(TestCase::class); -/** @return array */ +/** @return array */ function wingsResponse(string $operation, string $body): array { Http::fake(['*/api/*' => Http::response($body, 200, ['X-Request-Id' => 'invalid-response-123'])]);