From 8c1e8dd34ca5f675cfa4ade784659a44245577cd Mon Sep 17 00:00:00 2001 From: johnproblems <124836611+johnproblems@users.noreply.github.com> Date: Wed, 3 Dec 2025 19:06:46 +0000 Subject: [PATCH 1/3] fix: add @property annotations to models for PHPStan type safety MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added @property and @property-read PHPDoc annotations to 15 model files to declare Eloquent relationship properties and reduce PHPStan errors. Models updated: - ApplicationPreview - Environment - EnvironmentVariable - LocalFileVolume - LocalPersistentVolume - Organization - PrivateKey - Project - ScheduledTask - Service - SharedEnvironmentVariable - StandaloneDocker - SwarmDocker - Team - User Results: - Total errors reduced: 7145 → 6976 (169 fewer errors) - Undefined property errors: 788 → 694 (94 fewer errors) Part of PHPStan error resolution effort - Issue #203 --- app/Models/ApplicationPreview.php | 8 +++++++ app/Models/Environment.php | 18 ++++++++++++++ app/Models/EnvironmentVariable.php | 20 ++++++++++++++++ app/Models/LocalFileVolume.php | 4 ++++ app/Models/LocalPersistentVolume.php | 7 ++++++ app/Models/Organization.php | 25 +++++++++++++++++++- app/Models/PrivateKey.php | 16 +++++++++++++ app/Models/Project.php | 13 ++++++++++ app/Models/ScheduledTask.php | 17 ++++++++++++++ app/Models/Service.php | 30 ++++++++++++++++++++++++ app/Models/SharedEnvironmentVariable.php | 11 +++++++++ app/Models/StandaloneDocker.php | 17 ++++++++++++++ app/Models/SwarmDocker.php | 13 ++++++++++ app/Models/Team.php | 17 ++++++++++++++ app/Models/User.php | 22 +++++++++++++++++ 15 files changed, 237 insertions(+), 1 deletion(-) diff --git a/app/Models/ApplicationPreview.php b/app/Models/ApplicationPreview.php index 2ccb6473c4a..dc6a152205b 100644 --- a/app/Models/ApplicationPreview.php +++ b/app/Models/ApplicationPreview.php @@ -6,6 +6,14 @@ use Spatie\Url\Url; use Visus\Cuid2\Cuid2; +/** + * @property Application $application + * @property int $pull_request_id + * @property string|null $fqdn + * @property string|null $status + * @property string|null $docker_compose_domains + * @property \Illuminate\Database\Eloquent\Collection $persistentStorages + */ class ApplicationPreview extends BaseModel { use SoftDeletes; diff --git a/app/Models/Environment.php b/app/Models/Environment.php index 0410b54957e..3af3d2f6ea0 100644 --- a/app/Models/Environment.php +++ b/app/Models/Environment.php @@ -18,6 +18,24 @@ 'description' => ['type' => 'string'], ] )] +/** + * @property int $id + * @property string $uuid + * @property string $name + * @property int $project_id + * @property Project $project + * @property \Illuminate\Database\Eloquent\Collection $environment_variables + * @property \Illuminate\Database\Eloquent\Collection $applications + * @property \Illuminate\Database\Eloquent\Collection $postgresqls + * @property \Illuminate\Database\Eloquent\Collection $redis + * @property \Illuminate\Database\Eloquent\Collection $mongodbs + * @property \Illuminate\Database\Eloquent\Collection $mysqls + * @property \Illuminate\Database\Eloquent\Collection $mariadbs + * @property \Illuminate\Database\Eloquent\Collection $keydbs + * @property \Illuminate\Database\Eloquent\Collection $dragonflies + * @property \Illuminate\Database\Eloquent\Collection $clickhouses + * @property \Illuminate\Database\Eloquent\Collection $services + */ class Environment extends BaseModel { use ClearsGlobalSearchCache; diff --git a/app/Models/EnvironmentVariable.php b/app/Models/EnvironmentVariable.php index fc78b4ebb86..59c500ec216 100644 --- a/app/Models/EnvironmentVariable.php +++ b/app/Models/EnvironmentVariable.php @@ -29,6 +29,26 @@ 'updated_at' => ['type' => 'string'], ] )] +/** + * @property int $id + * @property string $uuid + * @property string $key + * @property string|null $value + * @property string|null $real_value + * @property bool $is_literal + * @property bool $is_multiline + * @property bool $is_preview + * @property bool $is_runtime + * @property bool $is_buildtime + * @property bool $is_shared + * @property bool $is_shown_once + * @property bool $is_required + * @property string|null $version + * @property string $resourceable_type + * @property int $resourceable_id + * @property Application|Service|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|null $resourceable + * @property Service|null $service + */ class EnvironmentVariable extends BaseModel { protected $guarded = []; diff --git a/app/Models/LocalFileVolume.php b/app/Models/LocalFileVolume.php index c5b19c3e411..1190dee7b8f 100644 --- a/app/Models/LocalFileVolume.php +++ b/app/Models/LocalFileVolume.php @@ -7,6 +7,10 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Symfony\Component\Yaml\Yaml; +/** + * @property Application|Service|ServiceApplication|ServiceDatabase $resource + * @property-read Service|null $service + */ class LocalFileVolume extends BaseModel { protected $casts = [ diff --git a/app/Models/LocalPersistentVolume.php b/app/Models/LocalPersistentVolume.php index a6736b78766..a399b3a9f31 100644 --- a/app/Models/LocalPersistentVolume.php +++ b/app/Models/LocalPersistentVolume.php @@ -6,6 +6,13 @@ use Illuminate\Database\Eloquent\Model; use Symfony\Component\Yaml\Yaml; +/** + * @property int $id + * @property string $name + * @property string $mount_path + * @property string|null $host_path + * @property Application|Service|ServiceApplication|ServiceDatabase|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|null $resource + */ class LocalPersistentVolume extends Model { protected $guarded = []; diff --git a/app/Models/Organization.php b/app/Models/Organization.php index c0d28430e25..4ac2ea9fc18 100644 --- a/app/Models/Organization.php +++ b/app/Models/Organization.php @@ -7,7 +7,30 @@ use Illuminate\Database\Eloquent\Model; /** - * @property-read WhiteLabelConfig|null $whiteLabelConfig + * @property int $id + * @property string $uuid + * @property string $name + * @property string|null $slug + * @property bool $whitelabel_public_access + * @property string|null $hierarchy_type + * @property int|null $hierarchy_level + * @property int|null $parent_organization_id + * @property array|null $branding_config + * @property array|null $feature_flags + * @property bool $is_active + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \App\Models\Organization|null $parent + * @property-read \Illuminate\Database\Eloquent\Collection $children + * @property-read \Illuminate\Database\Eloquent\Collection $users + * @property-read \App\Models\EnterpriseLicense|null $activeLicense + * @property-read \Illuminate\Database\Eloquent\Collection $licenses + * @property-read \Illuminate\Database\Eloquent\Collection $servers + * @property-read \App\Models\WhiteLabelConfig|null $whiteLabelConfig + * @property-read \Illuminate\Database\Eloquent\Collection $cloudProviderCredentials + * @property-read \Illuminate\Database\Eloquent\Collection $terraformDeployments + * @property-read \Illuminate\Database\Eloquent\Collection $applications + * @property-read \Illuminate\Database\Eloquent\Collection $domains */ class Organization extends Model { diff --git a/app/Models/PrivateKey.php b/app/Models/PrivateKey.php index f6637011432..d8a2a7ed548 100644 --- a/app/Models/PrivateKey.php +++ b/app/Models/PrivateKey.php @@ -27,6 +27,22 @@ 'updated_at' => ['type' => 'string'], ], )] +/** + * @property int $id + * @property string $uuid + * @property string $name + * @property string|null $description + * @property string $private_key + * @property string $public_key + * @property string|null $fingerprint + * @property bool $is_git_related + * @property int $team_id + * @property Team $team + * @property \Illuminate\Database\Eloquent\Collection $servers + * @property \Illuminate\Database\Eloquent\Collection $githubApps + * @property \Illuminate\Database\Eloquent\Collection $gitlabApps + * @property \Illuminate\Database\Eloquent\Collection $applications + */ class PrivateKey extends BaseModel { use HasSafeStringAttribute, WithRateLimiting; diff --git a/app/Models/Project.php b/app/Models/Project.php index bff5b2f094a..2da6c098294 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -23,6 +23,19 @@ ), ] )] +/** + * @property int $id + * @property string $uuid + * @property string $name + * @property string|null $description + * @property int $team_id + * @property \Illuminate\Database\Eloquent\Collection $environments + * @property \Illuminate\Database\Eloquent\Collection $environment_variables + * @property ProjectSetting|null $settings + * @property Team $team + * @property \Illuminate\Database\Eloquent\Collection $services + * @property \Illuminate\Database\Eloquent\Collection $applications + */ class Project extends BaseModel { use ClearsGlobalSearchCache; diff --git a/app/Models/ScheduledTask.php b/app/Models/ScheduledTask.php index bab23fb8385..d4b1e110b8f 100644 --- a/app/Models/ScheduledTask.php +++ b/app/Models/ScheduledTask.php @@ -6,6 +6,23 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; +/** + * @property int $id + * @property string $uuid + * @property string $name + * @property string $frequency + * @property string $command + * @property bool $enabled + * @property int|null $timeout + * @property int|null $application_id + * @property int|null $service_id + * @property int|null $database_id + * @property Application|null $application + * @property Service|null $service + * @property StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|null $database + * @property ScheduledTaskExecution|null $latest_log + * @property \Illuminate\Database\Eloquent\Collection $executions + */ class ScheduledTask extends BaseModel { use HasSafeStringAttribute; diff --git a/app/Models/Service.php b/app/Models/Service.php index df806e29bdf..d3b152320e5 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -17,6 +17,36 @@ use Spatie\Url\Url; use Visus\Cuid2\Cuid2; +/** + * @property int $id + * @property string $uuid + * @property string $name + * @property string|null $description + * @property int $environment_id + * @property int $server_id + * @property string|null $docker_compose_raw + * @property string|null $docker_compose + * @property string|null $destination_type + * @property int|null $destination_id + * @property bool $connect_to_docker_network + * @property bool $is_container_label_escape_enabled + * @property bool $is_container_label_readonly_enabled + * @property string|null $config_hash + * @property string|null $service_type + * @property string|null $compose_parsing_version + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property \Illuminate\Support\Carbon|null $deleted_at + * @property-read \App\Models\Server $server + * @property-read \App\Models\Environment $environment + * @property-read \App\Models\StandaloneDocker|\App\Models\SwarmDocker|null $destination + * @property-read \Illuminate\Database\Eloquent\Collection $applications + * @property-read \Illuminate\Database\Eloquent\Collection $databases + * @property-read \Illuminate\Database\Eloquent\Collection $environment_variables + * @property-read \Illuminate\Database\Eloquent\Collection $scheduled_tasks + * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages + * @property-read \Illuminate\Database\Eloquent\Collection $fileStorages + */ #[OA\Schema( description: 'Service model', type: 'object', diff --git a/app/Models/SharedEnvironmentVariable.php b/app/Models/SharedEnvironmentVariable.php index d5cfaf15fae..b77098197e1 100644 --- a/app/Models/SharedEnvironmentVariable.php +++ b/app/Models/SharedEnvironmentVariable.php @@ -4,6 +4,17 @@ use Illuminate\Database\Eloquent\Model; +/** + * @property int $id + * @property string $key + * @property string|null $value + * @property int|null $team_id + * @property int|null $project_id + * @property int|null $environment_id + * @property Team|null $team + * @property Project|null $project + * @property Environment|null $environment + */ class SharedEnvironmentVariable extends Model { protected $guarded = []; diff --git a/app/Models/StandaloneDocker.php b/app/Models/StandaloneDocker.php index 1e5f62b7b01..bde6b648f62 100644 --- a/app/Models/StandaloneDocker.php +++ b/app/Models/StandaloneDocker.php @@ -4,6 +4,23 @@ use App\Traits\HasSafeStringAttribute; +/** + * @property int $id + * @property int $server_id + * @property string $network + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \App\Models\Server $server + * @property-read \Illuminate\Database\Eloquent\Collection $applications + * @property-read \Illuminate\Database\Eloquent\Collection $postgresqls + * @property-read \Illuminate\Database\Eloquent\Collection $redis + * @property-read \Illuminate\Database\Eloquent\Collection $mongodbs + * @property-read \Illuminate\Database\Eloquent\Collection $mysqls + * @property-read \Illuminate\Database\Eloquent\Collection $mariadbs + * @property-read \Illuminate\Database\Eloquent\Collection $keydbs + * @property-read \Illuminate\Database\Eloquent\Collection $dragonflies + * @property-read \Illuminate\Database\Eloquent\Collection $clickhouses + */ class StandaloneDocker extends BaseModel { use HasSafeStringAttribute; diff --git a/app/Models/SwarmDocker.php b/app/Models/SwarmDocker.php index 159b0113476..e7efc0122e9 100644 --- a/app/Models/SwarmDocker.php +++ b/app/Models/SwarmDocker.php @@ -2,6 +2,19 @@ namespace App\Models; +/** + * @property Server $server + * @property \Illuminate\Database\Eloquent\Collection $applications + * @property \Illuminate\Database\Eloquent\Collection $postgresqls + * @property \Illuminate\Database\Eloquent\Collection $redis + * @property \Illuminate\Database\Eloquent\Collection $keydbs + * @property \Illuminate\Database\Eloquent\Collection $dragonflies + * @property \Illuminate\Database\Eloquent\Collection $clickhouses + * @property \Illuminate\Database\Eloquent\Collection $mongodbs + * @property \Illuminate\Database\Eloquent\Collection $mysqls + * @property \Illuminate\Database\Eloquent\Collection $mariadbs + * @property \Illuminate\Database\Eloquent\Collection $services + */ class SwarmDocker extends BaseModel { protected $guarded = []; diff --git a/app/Models/Team.php b/app/Models/Team.php index f932809ad9a..9ea435dd4d9 100644 --- a/app/Models/Team.php +++ b/app/Models/Team.php @@ -15,6 +15,23 @@ use Illuminate\Notifications\Notifiable; use OpenApi\Attributes as OA; +/** + * @property int $id + * @property string $name + * @property string|null $description + * @property bool $personal_team + * @property bool $show_boarding + * @property int|null $custom_server_limit + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection $members + * @property-read \App\Models\Subscription|null $subscription + * @property-read \Illuminate\Database\Eloquent\Collection $projects + * @property-read \Illuminate\Database\Eloquent\Collection $servers + * @property-read \Illuminate\Database\Eloquent\Collection $privateKeys + * @property-read array $limits + * @property-read object|null $pivot + */ #[OA\Schema( description: 'Team model', type: 'object', diff --git a/app/Models/User.php b/app/Models/User.php index 739df3ac7d3..7128e6ccb27 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -21,6 +21,28 @@ use Laravel\Sanctum\NewAccessToken; use OpenApi\Attributes as OA; +/** + * @property int $id + * @property string $name + * @property string $email + * @property string|null $password + * @property string|null $remember_token + * @property \Illuminate\Support\Carbon|null $email_verified_at + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property \Illuminate\Support\Carbon|null $two_factor_confirmed_at + * @property bool $force_password_reset + * @property bool $marketing_emails + * @property bool $show_boarding + * @property string|null $pending_email + * @property string|null $email_change_code + * @property \Illuminate\Support\Carbon|null $email_change_code_expires_at + * @property-read \Illuminate\Database\Eloquent\Collection $teams + * @property-read \Illuminate\Database\Eloquent\Collection $organizations + * @property-read \App\Models\Organization|null $currentOrganization + * @property-read \App\Models\Team|null $currentTeam + * @property-read object|null $pivot + */ #[OA\Schema( description: 'User model', type: 'object', From 2496c27eb73cfdeae465246db7650eccc7a4e43a Mon Sep 17 00:00:00 2001 From: johnproblems <124836611+johnproblems@users.noreply.github.com> Date: Wed, 3 Dec 2025 19:55:19 +0000 Subject: [PATCH 2/3] fix: Add @property annotations to models for PHPStan type safety (Session 6) Added @property and @property-read PHPDoc annotations to 11 Eloquent model files to declare computed attributes and improve PHPStan static analysis. Models Updated: - Application: ports_exposes_array, ports_mappings_array, fqdns, custom_network_aliases_array, server_status, watch_paths, status, image, pull_request_id, is_container_label_readonly_enabled, custom_docker_run_options, custom_labels - Server: getIp (computed IP attribute) - ApplicationDeploymentQueue: server (computed via deployment) - StandaloneRedis: redis_password, redis_username, ssl_mode, internal_db_url, external_db_url - StandaloneKeydb: ssl_mode, internal_db_url, external_db_url - StandaloneDragonfly: ssl_mode, internal_db_url, external_db_url - StandaloneClickhouse: clickhouse_db, internal_db_url, external_db_url, ports_mappings_array - StandalonePostgresql: internal_db_url, external_db_url - StandaloneMongodb: internal_db_url, external_db_url - StandaloneMysql: internal_db_url, external_db_url - StandaloneMariadb: internal_db_url, external_db_url PHPStan Results: - Before: 6,976 errors - After: 6,805 errors - Reduction: 171 errors (2.5%) Issue: #203 --- app/Models/Application.php | 15 +++++++++++++++ app/Models/ApplicationDeploymentQueue.php | 6 ++++++ app/Models/Server.php | 4 ++++ app/Models/StandaloneClickhouse.php | 12 ++++++++++++ app/Models/StandaloneDragonfly.php | 11 +++++++++++ app/Models/StandaloneKeydb.php | 10 ++++++++++ app/Models/StandaloneMariadb.php | 10 ++++++++++ app/Models/StandaloneMongodb.php | 10 ++++++++++ app/Models/StandaloneMysql.php | 10 ++++++++++ app/Models/StandalonePostgresql.php | 10 ++++++++++ app/Models/StandaloneRedis.php | 4 ++++ 11 files changed, 102 insertions(+) diff --git a/app/Models/Application.php b/app/Models/Application.php index beca0527355..1204a5c0af3 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -122,6 +122,21 @@ * @property-read \Illuminate\Database\Eloquent\Collection $additional_servers * @property-read \Illuminate\Database\Eloquent\Collection $additional_networks * @property-read \Illuminate\Database\Eloquent\Collection $scheduled_tasks + * @property-read array $ports_exposes_array Computed attribute from ports_exposes + * @property-read array $ports_mappings_array Computed attribute from ports_mappings + * @property-read array $fqdns Computed attribute from fqdn + * @property-read array $custom_network_aliases_array Computed attribute from custom_network_aliases + * @property-read string|null $git_branch_location Computed Git branch location + * @property-read string|null $git_webhook Computed Git webhook URL + * @property-read array $git_commits Git commits information + * @property-read bool $server_status Server health status + * @property-read array|null $watch_paths Computed watch paths + * @property string $status Application status + * @property string|null $image Docker image (via docker_registry_image_name) + * @property int|null $pull_request_id Pull request ID for preview deployments + * @property bool $is_container_label_readonly_enabled Container label readonly setting + * @property string|null $custom_docker_run_options Custom Docker run options + * @property string|null $custom_labels Custom labels for the container */ class Application extends BaseModel { diff --git a/app/Models/ApplicationDeploymentQueue.php b/app/Models/ApplicationDeploymentQueue.php index 123a935f947..e318d54c3ca 100644 --- a/app/Models/ApplicationDeploymentQueue.php +++ b/app/Models/ApplicationDeploymentQueue.php @@ -8,6 +8,12 @@ use Illuminate\Support\Facades\DB; use OpenApi\Attributes as OA; +/** + * @property-read \App\Models\Server|null $server Computed from server_id + * @property-read \App\Models\Application $application + * @property int|null $server_id Server ID for deployment + * @property int $pull_request_id Pull request ID (0 for main deployment) + */ #[OA\Schema( description: 'Project model', type: 'object', diff --git a/app/Models/Server.php b/app/Models/Server.php index d835fba4763..e491fca63f9 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -89,6 +89,10 @@ * @property \App\Models\CloudProviderToken|null $cloudProviderToken * @property \Illuminate\Database\Eloquent\Collection $sslCertificates * @property \Illuminate\Database\Eloquent\Collection $services + * @property-read string $getIp Computed IP address (localhost returns base_ip in dev) + * @property int $port Server SSH port + * @property string $user Server SSH user + * @property string $ip Server IP address */ #[OA\Schema( description: 'Server model', diff --git a/app/Models/StandaloneClickhouse.php b/app/Models/StandaloneClickhouse.php index d14963fc5d1..a86d25ce599 100644 --- a/app/Models/StandaloneClickhouse.php +++ b/app/Models/StandaloneClickhouse.php @@ -8,6 +8,18 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * @property-read \App\Models\Environment $environment + * @property-read \App\Models\StandaloneDocker|\App\Models\SwarmDocker $destination + * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages + * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables + * @property-read string $internal_db_url + * @property-read string $external_db_url + * @property-read string $database_type + * @property string|null $clickhouse_db ClickHouse database name + * @property-read array $ports_mappings_array Computed array from ports_mappings + * @property-read bool $server_status Server functional status + */ class StandaloneClickhouse extends BaseModel { use ClearsGlobalSearchCache, HasFactory, HasSafeStringAttribute, SoftDeletes; diff --git a/app/Models/StandaloneDragonfly.php b/app/Models/StandaloneDragonfly.php index f793247d0d8..0a62d1d7c5c 100644 --- a/app/Models/StandaloneDragonfly.php +++ b/app/Models/StandaloneDragonfly.php @@ -8,6 +8,17 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * @property-read \App\Models\Environment $environment + * @property-read \App\Models\StandaloneDocker|\App\Models\SwarmDocker $destination + * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages + * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables + * @property-read string $internal_db_url + * @property-read string $external_db_url + * @property-read string $database_type + * @property string|null $ssl_mode SSL mode for connection + * @property-read bool $server_status Server functional status + */ class StandaloneDragonfly extends BaseModel { use ClearsGlobalSearchCache, HasFactory, HasSafeStringAttribute, SoftDeletes; diff --git a/app/Models/StandaloneKeydb.php b/app/Models/StandaloneKeydb.php index 54a4dcd0248..14a4811dbe6 100644 --- a/app/Models/StandaloneKeydb.php +++ b/app/Models/StandaloneKeydb.php @@ -8,6 +8,16 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * @property-read \App\Models\Environment $environment + * @property-read \App\Models\StandaloneDocker|\App\Models\SwarmDocker $destination + * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages + * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables + * @property-read string $internal_db_url + * @property-read string $external_db_url + * @property string|null $ssl_mode SSL mode for connection + * @property-read bool $server_status Server functional status + */ class StandaloneKeydb extends BaseModel { use ClearsGlobalSearchCache, HasFactory, HasSafeStringAttribute, SoftDeletes; diff --git a/app/Models/StandaloneMariadb.php b/app/Models/StandaloneMariadb.php index 90e681bb30f..ff2d3211df7 100644 --- a/app/Models/StandaloneMariadb.php +++ b/app/Models/StandaloneMariadb.php @@ -9,6 +9,16 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * @property-read \App\Models\Environment $environment + * @property-read \App\Models\StandaloneDocker|\App\Models\SwarmDocker $destination + * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages + * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables + * @property-read string $internal_db_url + * @property-read string $external_db_url + * @property-read string $database_type + * @property-read bool $server_status Server functional status + */ class StandaloneMariadb extends BaseModel { use ClearsGlobalSearchCache, HasFactory, HasSafeStringAttribute, SoftDeletes; diff --git a/app/Models/StandaloneMongodb.php b/app/Models/StandaloneMongodb.php index 252be88eb60..f7daba455ff 100644 --- a/app/Models/StandaloneMongodb.php +++ b/app/Models/StandaloneMongodb.php @@ -8,6 +8,16 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * @property-read \App\Models\Environment $environment + * @property-read \App\Models\StandaloneDocker|\App\Models\SwarmDocker $destination + * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages + * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables + * @property-read string $internal_db_url + * @property-read string $external_db_url + * @property-read string $database_type + * @property-read bool $server_status Server functional status + */ class StandaloneMongodb extends BaseModel { use ClearsGlobalSearchCache, HasFactory, HasSafeStringAttribute, SoftDeletes; diff --git a/app/Models/StandaloneMysql.php b/app/Models/StandaloneMysql.php index fb89df0929f..d84dc9e7000 100644 --- a/app/Models/StandaloneMysql.php +++ b/app/Models/StandaloneMysql.php @@ -8,6 +8,16 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * @property-read \App\Models\Environment $environment + * @property-read \App\Models\StandaloneDocker|\App\Models\SwarmDocker $destination + * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages + * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables + * @property-read string $internal_db_url + * @property-read string $external_db_url + * @property-read string $database_type + * @property-read bool $server_status Server functional status + */ class StandaloneMysql extends BaseModel { use ClearsGlobalSearchCache, HasFactory, HasSafeStringAttribute, SoftDeletes; diff --git a/app/Models/StandalonePostgresql.php b/app/Models/StandalonePostgresql.php index 0619f34a6c0..bf58ff3aceb 100644 --- a/app/Models/StandalonePostgresql.php +++ b/app/Models/StandalonePostgresql.php @@ -8,6 +8,16 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * @property-read \App\Models\Environment $environment + * @property-read \App\Models\StandaloneDocker|\App\Models\SwarmDocker $destination + * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages + * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables + * @property-read string $internal_db_url + * @property-read string $external_db_url + * @property-read string $database_type + * @property-read bool $server_status Server functional status + */ class StandalonePostgresql extends BaseModel { use ClearsGlobalSearchCache, HasFactory, HasSafeStringAttribute, SoftDeletes; diff --git a/app/Models/StandaloneRedis.php b/app/Models/StandaloneRedis.php index 7b7743f1568..44ffde98d7c 100644 --- a/app/Models/StandaloneRedis.php +++ b/app/Models/StandaloneRedis.php @@ -16,6 +16,10 @@ * @property-read string $internal_db_url * @property-read string $external_db_url * @property-read string $database_type + * @property string|null $redis_password Redis password + * @property string $redis_username Redis username (defaults to 'default') + * @property string|null $ssl_mode SSL mode for connection + * @property-read bool $server_status Server functional status */ class StandaloneRedis extends BaseModel { From 20f18f43e28613ffca34aece09a21a4c4bd00292 Mon Sep 17 00:00:00 2001 From: johnproblems <124836611+johnproblems@users.noreply.github.com> Date: Wed, 3 Dec 2025 20:14:21 +0000 Subject: [PATCH 3/3] fix: Address CodeRabbit review comments - Fix Application.php: is string|null (not array), is string|null (not array) - Fix external_db_url to string|null in 5 standalone models (Keydb, Mariadb, Mongodb, Mysql, Redis) - Add missing Standalone DB types to LocalPersistentVolume resource union - Add services relationship to StandaloneDocker PHPDoc --- app/Models/Application.php | 4 ++-- app/Models/LocalPersistentVolume.php | 2 +- app/Models/StandaloneDocker.php | 1 + app/Models/StandaloneKeydb.php | 2 +- app/Models/StandaloneMariadb.php | 3 +-- app/Models/StandaloneMongodb.php | 2 +- app/Models/StandaloneMysql.php | 2 +- app/Models/StandaloneRedis.php | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Models/Application.php b/app/Models/Application.php index 1204a5c0af3..e4f9672a8c5 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -128,9 +128,9 @@ * @property-read array $custom_network_aliases_array Computed attribute from custom_network_aliases * @property-read string|null $git_branch_location Computed Git branch location * @property-read string|null $git_webhook Computed Git webhook URL - * @property-read array $git_commits Git commits information + * @property-read string|null $git_commits Git commits URL * @property-read bool $server_status Server health status - * @property-read array|null $watch_paths Computed watch paths + * @property string|null $watch_paths Normalized watch paths (newline-separated) * @property string $status Application status * @property string|null $image Docker image (via docker_registry_image_name) * @property int|null $pull_request_id Pull request ID for preview deployments diff --git a/app/Models/LocalPersistentVolume.php b/app/Models/LocalPersistentVolume.php index a399b3a9f31..3538b622221 100644 --- a/app/Models/LocalPersistentVolume.php +++ b/app/Models/LocalPersistentVolume.php @@ -11,7 +11,7 @@ * @property string $name * @property string $mount_path * @property string|null $host_path - * @property Application|Service|ServiceApplication|ServiceDatabase|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|null $resource + * @property Application|Service|ServiceApplication|ServiceDatabase|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse|null $resource */ class LocalPersistentVolume extends Model { diff --git a/app/Models/StandaloneDocker.php b/app/Models/StandaloneDocker.php index bde6b648f62..582b443c1fd 100644 --- a/app/Models/StandaloneDocker.php +++ b/app/Models/StandaloneDocker.php @@ -20,6 +20,7 @@ * @property-read \Illuminate\Database\Eloquent\Collection $keydbs * @property-read \Illuminate\Database\Eloquent\Collection $dragonflies * @property-read \Illuminate\Database\Eloquent\Collection $clickhouses + * @property-read \Illuminate\Database\Eloquent\Collection $services */ class StandaloneDocker extends BaseModel { diff --git a/app/Models/StandaloneKeydb.php b/app/Models/StandaloneKeydb.php index 14a4811dbe6..cbdc953da37 100644 --- a/app/Models/StandaloneKeydb.php +++ b/app/Models/StandaloneKeydb.php @@ -14,7 +14,7 @@ * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables * @property-read string $internal_db_url - * @property-read string $external_db_url + * @property-read string|null $external_db_url * @property string|null $ssl_mode SSL mode for connection * @property-read bool $server_status Server functional status */ diff --git a/app/Models/StandaloneMariadb.php b/app/Models/StandaloneMariadb.php index ff2d3211df7..c9368614253 100644 --- a/app/Models/StandaloneMariadb.php +++ b/app/Models/StandaloneMariadb.php @@ -6,7 +6,6 @@ use App\Traits\HasSafeStringAttribute; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; -use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Database\Eloquent\SoftDeletes; /** @@ -15,7 +14,7 @@ * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables * @property-read string $internal_db_url - * @property-read string $external_db_url + * @property-read string|null $external_db_url * @property-read string $database_type * @property-read bool $server_status Server functional status */ diff --git a/app/Models/StandaloneMongodb.php b/app/Models/StandaloneMongodb.php index f7daba455ff..5cc1b70deb6 100644 --- a/app/Models/StandaloneMongodb.php +++ b/app/Models/StandaloneMongodb.php @@ -14,7 +14,7 @@ * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables * @property-read string $internal_db_url - * @property-read string $external_db_url + * @property-read string|null $external_db_url * @property-read string $database_type * @property-read bool $server_status Server functional status */ diff --git a/app/Models/StandaloneMysql.php b/app/Models/StandaloneMysql.php index d84dc9e7000..d5121d95c80 100644 --- a/app/Models/StandaloneMysql.php +++ b/app/Models/StandaloneMysql.php @@ -14,7 +14,7 @@ * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables * @property-read string $internal_db_url - * @property-read string $external_db_url + * @property-read string|null $external_db_url * @property-read string $database_type * @property-read bool $server_status Server functional status */ diff --git a/app/Models/StandaloneRedis.php b/app/Models/StandaloneRedis.php index 44ffde98d7c..217e13eb8a6 100644 --- a/app/Models/StandaloneRedis.php +++ b/app/Models/StandaloneRedis.php @@ -14,7 +14,7 @@ * @property-read \Illuminate\Database\Eloquent\Collection $persistentStorages * @property-read \Illuminate\Database\Eloquent\Collection $runtime_environment_variables * @property-read string $internal_db_url - * @property-read string $external_db_url + * @property-read string|null $external_db_url * @property-read string $database_type * @property string|null $redis_password Redis password * @property string $redis_username Redis username (defaults to 'default')