Skip to content

Conversation

@johnproblems
Copy link
Owner

@johnproblems johnproblems commented Dec 3, 2025

Summary

Adds explicit return type declarations to Action and Job classes as part of the PHPStan error resolution effort.

Changes

  • 79 PHPStan errors fixed (6,805 → 6,726)
  • 55 files modified across:
    • Database Actions (13 files)
    • Application Actions (5 files)
    • Service Actions (4 files)
    • Server Actions (14 files)
    • Proxy Actions (1 file)
    • Shared Actions (1 file)
    • Jobs (16 files)

Key Patterns Applied

  1. handle(): ?Activity for methods calling remote_process() with early returns
  2. handle(): Activity for methods always returning remote_process()
  3. handle(): void for Job classes
  4. Fixed void functions incorrectly returning values

Related

Verification

vendor/bin/phpstan analyze -c phpstan.neon --memory-limit=-1 --error-format=table 2>&1 | tail -20
# Result: 6726 errors

Note

Adds explicit return type declarations to Action and Job classes to reduce PHPStan errors and standardize method signatures.

  • Actions
    • Standardize handle() return types across Application, Database, Service, Server, Proxy, and Shared actions (e.g., Activity, ?Activity, or void as appropriate).
    • Remove/adjust unintended returns in functions meant to be void.
  • Jobs
    • Declare handle(): void for job classes and fix any methods incorrectly returning values.
  • Static Analysis
    • Reduce PHPStan errors by tightening type declarations and aligning implementations with expected return types.

Written by Cursor Bugbot for commit 0993ba0. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Refactor
    • Added explicit return type declarations across action and job handler classes to strengthen type safety and IDE support. Updated method signatures include void, string, array, and Activity return types, with associated minor control flow adjustments to align with new type contracts. No user-facing functionality changes.

✏️ Tip: You can customize this high-level summary in your review settings.

PHPStan Error Resolution Session 7: Return Type Declarations

## Summary
- Baseline: 6,805 errors
- After: 6,726 errors
- Reduction: 79 errors

## Changes Made

### Database Actions (13 files)
- StartClickhouse, StartDragonfly, StartKeydb, StartMariadb, StartMongodb,
  StartMysql, StartPostgresql, StartRedis: Added Activity return types and
  PHPDoc annotations for array return types on helper methods
- RestartDatabase, StartDatabase: Added string|Activity|null return types
- StopDatabase: Already had return types (verified)
- StartDatabaseProxy, StopDatabaseProxy: Added void return types

### Application Actions (5 files)
- GenerateConfig: Added string|array return type
- LoadComposeFile: Added void return type
- StopApplication, StopApplicationOneServer: Added ?string return types
- IsHorizonQueueEmpty: Added bool return type

### Service Actions (4 files)
- StartService, RestartService: Added Activity return types
- StopService: Added ?string return type
- DeleteService: Added void return type

### Server Actions (14 files)
- CheckUpdates: Added array return type with PHPDoc
- CleanupDocker: Added array return type with PHPDoc
- DeleteServer, ResourcesCheck, RestartContainer, StopSentinel,
  StartSentinel, UpdateCoolify: Added void return types
- InstallDocker, InstallPrerequisites, RunCommand: Added Activity return types
- StartLogDrain: Added string|Activity return type
- StopLogDrain: Added ?string return type
- ValidateServer: Added string return type

### Proxy Actions (1 file)
- StopProxy: Added void return type

### Shared Actions (1 file)
- ComplexStatusCheck: Added void return type

### Jobs (16 files)
- Added void return types to all Job handle() methods
- Fixed return statements in void functions (changed 'return value' to 'return')

## Technical Notes
- Used Spatie\Activitylog\Contracts\Activity for remote_process() returns
- Nullable return types (?Activity) used where SSL errors cause early returns
- PHPDoc @return annotations added for complex array types

Relates to #203
@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

Walkthrough

This PR systematically adds explicit return type declarations to numerous handle() methods across application actions, database operations, server management, service handling, and job queue handlers. The changes enforce type contracts without modifying underlying logic or control flow.

Changes

Cohort / File(s) Summary
Application Actions
app/Actions/Application/GenerateConfig.php, IsHorizonQueueEmpty.php, LoadComposeFile.php, StopApplication.php, StopApplicationOneServer.php
Added return type annotations (string|array, bool, void, ?string) to handle methods. Some methods now explicitly return null in early exits instead of implicit void returns.
Database Start Actions
app/Actions/Database/Start{Clickhouse,Dragonfly,Keydb,Mariadb,Mongodb,Mysql,Postgresql,Redis}.php
Added ?Activity return types to handle methods and Activity imports. Added explicit return type annotations to private helper methods (generate_local_persistent_volumes(), generate_environment_variables(), etc. returning array). Error paths now return null instead of implicit void.
Database Management Actions
app/Actions/Database/{RestartDatabase,StartDatabase,StartDatabaseProxy,StopDatabase,StopDatabaseProxy}.php
Added return type annotations: string|Activity|null, string|Activity|null, void, string, void respectively. Added Activity imports where needed.
Server Status/Check Actions
app/Actions/Server/{CheckUpdates,CleanupDocker,ResourcesCheck,ValidateServer}.php
Added return type annotations (array, array, void, string). Added PHPDoc blocks documenting return shapes for array-returning methods.
Server Control Actions
app/Actions/Server/{DeleteServer,InstallDocker,InstallPrerequisites,RestartContainer,RunCommand,StartLogDrain,StartSentinel,StopLogDrain,StopSentinel,UpdateCoolify}.php
Added return type annotations (void, Activity, Activity, void, Activity, string|Activity, void, ?string, void, void). Added Activity imports where applicable.
Service Actions
app/Actions/Service/{DeleteService,RestartService,StartService,StopService}.php
Added return type annotations (void, Activity, Activity, ?string). Added Activity imports. StopService now explicitly returns null on success.
Proxy & Shared Actions
app/Actions/Proxy/StopProxy.php, app/Actions/Shared/ComplexStatusCheck.php
Added void return types. StopProxy error handler now calls handleError() without returning.
Job Handlers
app/Jobs/{ApplicationPullRequestUpdateJob,CleanupStaleMultiplexedConnections,DeleteResourceJob,GithubAppPermissionJob,PushServerUpdateJob,RegenerateSslCertJob,RestartProxyJob,ServerCheckJob,ServerCleanupMux,ServerConnectionCheckJob,ServerFilesFromServerJob,ServerLimitCheckJob,ServerStorageCheckJob,ServerStorageSaveJob,SubscriptionInvoiceFailedJob,VolumeCloneJob}.php
Added explicit void return type annotations to all handle methods. Some error handlers changed from returning handleError($e) result to calling without return.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Key areas requiring attention during review:

  • Verify that added return type declarations match actual return values in all code paths (particularly critical for ?Activity and string|Activity|null returns)
  • Confirm that changes from implicit void to explicit return null; statements preserve intended behavior
  • Validate that Activity imports and return types are correctly aligned across database start methods
  • Check that error handling changes (removing return from handleError($e) calls in jobs/proxy) don't impact error reporting
  • Ensure private helper method return type annotations accurately reflect their outputs

Poem

🐰 Return types now declared, so precise and so bright,
No more guessing games—each function knows right!
From void to Activity, from null to string clear,
Type safety hops forward, no ambiguity here!
A hop-skip-and-jump toward better PHP fate!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.08% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding return type declarations to Actions and Jobs classes.
Description check ✅ Passed The description includes a comprehensive summary, detailed changes breakdown, key patterns applied, verification steps, and related context. However, the required template sections (checklist completion and issues link) are not fully addressed.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch session-7-return-types

Comment @coderabbitai help to get the list of available commands and usage tips.

@johnproblems
Copy link
Owner Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
app/Actions/Server/StartLogDrain.php (1)

15-221: Incorrect return type: remove Activity from the union type.

The method declares string|Activity as the return type, but this is inaccurate:

  • instant_remote_process() returns ?string (see bootstrap/helpers/remoteProcess.php:121), not Activity
  • handleError() returns mixed string/void types, not Activity
  • Line 33 returns a string literal 'No log drain is enabled.'

The Activity type is never actually returned. The correct return type should be ?string to accurately reflect that instant_remote_process() can return either a string or null.

Change the method signature to: public function handle(Server $server): ?string

app/Jobs/ApplicationPullRequestUpdateJob.php (1)

32-67: handle(): void cannot return $e from the catch block

With the handle(): void signature, line 66 is invalid:

return $e;

PHP does not allow returning a value from a void function. To maintain proper Laravel job semantics (exceptions mark the job as failed), rethrow the exception:

        } catch (\Throwable $e) {
-           return $e;
+           throw $e;
+       }

If you need to log or notify before failing, do so before rethrowing.

app/Jobs/ServerStorageCheckJob.php (1)

31-64: Remove return values from handle(): void method—they will cause runtime TypeErrors

The handle() method declares a void return type but returns string values and the result of handleError($e). PHP 7.1+ strictly enforces this and will throw a TypeError at runtime.

Queued jobs don't consume return values anyway. Simply remove the returned values while preserving early exits:

     public function handle(): void
     {
         try {
             if ($this->server->isFunctional() === false) {
-                return 'Server is not functional.';
+                return;
             }
             $team = data_get($this->server, 'team');
             $serverDiskUsageNotificationThreshold = data_get($this->server, 'settings.server_disk_usage_notification_threshold');
 
             if (is_null($this->percentage)) {
                 $this->percentage = $this->server->storageCheck();
             }
             if (! $this->percentage) {
-                return 'No percentage could be retrieved.';
+                return;
             }
             if ($this->percentage > $serverDiskUsageNotificationThreshold) {
                 $executed = RateLimiter::attempt(
                     'high-disk-usage:'.$this->server->id,
                     $maxAttempts = 0,
                     function () use ($team, $serverDiskUsageNotificationThreshold) {
                         $team->notify(new HighDiskUsage($this->server, $this->percentage, $serverDiskUsageNotificationThreshold));
                     },
                     $decaySeconds = 3600,
                 );
 
                 if (! $executed) {
-                    return 'Too many messages sent!';
+                    return;
                 }
             } else {
                 RateLimiter::hit('high-disk-usage:'.$this->server->id, 600);
             }
         } catch (\Throwable $e) {
-            return handleError($e);
+            handleError($e);
         }
     }
app/Jobs/ServerLimitCheckJob.php (1)

28-52: Remove return statement from void handle() method

The handle() method is declared as void (line 28), but line 52 attempts to return handleError($e);. A void function cannot return a value in PHP, and since handleError() returns a string for exceptions like TooManyRequestsException and UniqueConstraintViolationException, this will cause a fatal error at runtime.

Remove the return keyword:

        } catch (\Throwable $e) {
            send_internal_notification('ServerLimitCheckJob failed with: '.$e->getMessage());
-
-            return handleError($e);
+
+            handleError($e);
        }
app/Actions/Server/DeleteServer.php (1)

16-27: Fix null dereference risk in Hetzner deletion when server record is missing

The void return type at line 16 is appropriate for this action pattern, but there is a critical bug in the Hetzner deletion logic (lines 21–26).

When $server is null but $hetznerServerId is provided, the code attempts to pass $teamId ?? $server->team_id to deleteFromHetznerById(). If both $teamId and $server are null, this expression evaluates to null. However, deleteFromHetznerById() expects $teamId to be a non-nullable int, causing a TypeError.

Scenario: Call handle(serverId=999, deleteFromHetzner=true, hetznerServerId=123, teamId=null) where server 999 is already deleted. The condition at line 21 passes, but $server->team_id on a null object crashes.

Use null-safe access and validate derived IDs before calling the method:

if ($deleteFromHetzner && ($hetznerServerId || ($server && $server->hetzner_server_id))) {
    $effectiveHetznerId = $hetznerServerId ?? $server?->hetzner_server_id;
    $effectiveTokenId = $cloudProviderTokenId ?? $server?->cloud_provider_token_id;
    $effectiveTeamId = $teamId ?? $server?->team_id;

    if ($effectiveHetznerId && $effectiveTeamId) {
        $this->deleteFromHetznerById($effectiveHetznerId, $effectiveTokenId, $effectiveTeamId);
    }
}
🧹 Nitpick comments (7)
app/Jobs/CleanupStaleMultiplexedConnections.php (1)

25-81: Add return & parameter types to private methods for full guideline compliance

To fully align with the project rule “always add explicit return type declarations for methods and functions” under app/**/*.php, consider adding types to the helper methods as well:

  • cleanupStaleConnections(): void
  • cleanupNonExistentServerConnections(): void
  • extractServerUuidFromMuxFile(string $muxFile): string
  • removeMultiplexFile(string $muxFile): void

Example patch:

-    private function cleanupStaleConnections()
+    private function cleanupStaleConnections(): void
@@
-    private function cleanupNonExistentServerConnections()
+    private function cleanupNonExistentServerConnections(): void
@@
-    private function extractServerUuidFromMuxFile($muxFile)
+    private function extractServerUuidFromMuxFile(string $muxFile): string
@@
-    private function removeMultiplexFile($muxFile)
+    private function removeMultiplexFile(string $muxFile): void

This keeps the file consistent with the PR’s goal of tightening return types and the app-level coding guidelines.

As per coding guidelines, …

app/Actions/Server/ValidateServer.php (1)

26-77: Return type is consistent; consider call‑site expectations and minor duplication

The handle(Server $server): string signature matches the implementation: every non-error path now returns the literal 'OK', while all failure paths throw after updating validation_logs, so there are no missing-return branches.

Two minor follow-ups to keep in mind:

  • If any existing callers relied on the previous void/implicit return (e.g., never inspected the result), they’re still fine, but please double‑check that no code expects a different return type (like bool or an array) from ValidateServer::run() or equivalent.
  • The “Docker Engine is not installed...” message is duplicated in the checks at Lines 61 and 72; you could optionally extract this into a local variable or helper to avoid divergence in future edits.
app/Actions/Server/CleanupDocker.php (1)

14-17: Return type + PHPDoc look correct for the cleanup log structure

The explicit : array return type and the PHPDoc shape array<int, array{command: string, output: string|null}> line up with the $cleanupLog structure and with how CleanupDocker::run(...) is consumed in DockerCleanupJob. If you want PHPStan to infer an even narrower type, you could change output: string|null to output: string since you only append entries when $commandOutput !== null, but the current annotation is still safe and accurate enough for this PR. Based on learnings, this also aligns with the guideline to always add explicit return types under app/**/*.php.

app/Jobs/DeleteResourceJob.php (1)

116-203: Consider adding void return types to private helpers for consistency

Both deleteApplicationPreview and stopPreviewContainers perform side effects only and never return a value. You could tighten their signatures to:

-    private function deleteApplicationPreview()
+    private function deleteApplicationPreview(): void
@@
-    private function stopPreviewContainers(array $containers, $server, int $timeout = 30)
+    private function stopPreviewContainers(array $containers, $server, int $timeout = 30): void

This keeps the file fully consistent with the “explicit return types for app methods” convention. As per coding guidelines, ...

app/Actions/Shared/ComplexStatusCheck.php (1)

15-62: ComplexStatusCheck handle(): void matches behavior; consider typing helper as well

The handle(Application $application): void signature fits this action: it only performs remote checks and status updates, without returning a value. As a follow‑up, you might also add an explicit return type to aggregateContainerStatuses() to fully align with the “explicit return types everywhere” guideline (likely a string status). As per coding guidelines, ...

app/Actions/Database/StartDragonfly.php (1)

221-274: Volume and environment helper types are well-specified

The new PHPDoc and array return types on the volume/environment helpers accurately describe the produced structures (string volume specs and keyed volume definitions), which is helpful for static analysis. The implementations match the documented shapes.

Minor nit: \$container_name and \$this->configuration_dir are assigned twice in handle(); if you touch this file again, you could collapse that duplication for clarity, but it’s not functionally problematic.

app/Actions/Database/StartDatabase.php (1)

14-15: handle() return type matches delegated Start actions; consider initializing $activity*

Typing handle() as string|Activity|null accurately reflects the string early-return and the various Start*::run(...) results. To future-proof this a bit, you might want to initialize $activity = null; before the switch or add a default case that throws, so adding a new database type without updating the switch can’t yield an undefined $activity.

     public function handle(StandaloneRedis|StandalonePostgresql|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse $database): string|Activity|null
     {
         $server = $database->destination->server;
         if (! $server->isFunctional()) {
             return 'Server is not functional';
         }
+        $activity = null;
         switch ($database->getMorphClass()) {
             case \App\Models\StandalonePostgresql::class:
                 $activity = StartPostgresql::run($database);
                 break;
             // ...
         }

Also applies to: 22-59

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d38572 and 0993ba0.

📒 Files selected for processing (54)
  • app/Actions/Application/GenerateConfig.php (1 hunks)
  • app/Actions/Application/IsHorizonQueueEmpty.php (1 hunks)
  • app/Actions/Application/LoadComposeFile.php (1 hunks)
  • app/Actions/Application/StopApplication.php (3 hunks)
  • app/Actions/Application/StopApplicationOneServer.php (2 hunks)
  • app/Actions/Database/RestartDatabase.php (1 hunks)
  • app/Actions/Database/StartClickhouse.php (5 hunks)
  • app/Actions/Database/StartDatabase.php (1 hunks)
  • app/Actions/Database/StartDatabaseProxy.php (1 hunks)
  • app/Actions/Database/StartDragonfly.php (6 hunks)
  • app/Actions/Database/StartKeydb.php (7 hunks)
  • app/Actions/Database/StartMariadb.php (7 hunks)
  • app/Actions/Database/StartMongodb.php (8 hunks)
  • app/Actions/Database/StartMysql.php (7 hunks)
  • app/Actions/Database/StartPostgresql.php (8 hunks)
  • app/Actions/Database/StartRedis.php (7 hunks)
  • app/Actions/Database/StopDatabase.php (1 hunks)
  • app/Actions/Database/StopDatabaseProxy.php (1 hunks)
  • app/Actions/Proxy/StopProxy.php (2 hunks)
  • app/Actions/Server/CheckUpdates.php (1 hunks)
  • app/Actions/Server/CleanupDocker.php (1 hunks)
  • app/Actions/Server/DeleteServer.php (1 hunks)
  • app/Actions/Server/InstallDocker.php (1 hunks)
  • app/Actions/Server/InstallPrerequisites.php (1 hunks)
  • app/Actions/Server/ResourcesCheck.php (2 hunks)
  • app/Actions/Server/RestartContainer.php (1 hunks)
  • app/Actions/Server/RunCommand.php (1 hunks)
  • app/Actions/Server/StartLogDrain.php (1 hunks)
  • app/Actions/Server/StartSentinel.php (1 hunks)
  • app/Actions/Server/StopLogDrain.php (1 hunks)
  • app/Actions/Server/StopSentinel.php (1 hunks)
  • app/Actions/Server/UpdateCoolify.php (2 hunks)
  • app/Actions/Server/ValidateServer.php (1 hunks)
  • app/Actions/Service/DeleteService.php (1 hunks)
  • app/Actions/Service/RestartService.php (1 hunks)
  • app/Actions/Service/StartService.php (2 hunks)
  • app/Actions/Service/StopService.php (2 hunks)
  • app/Actions/Shared/ComplexStatusCheck.php (1 hunks)
  • app/Jobs/ApplicationPullRequestUpdateJob.php (1 hunks)
  • app/Jobs/CleanupStaleMultiplexedConnections.php (1 hunks)
  • app/Jobs/DeleteResourceJob.php (1 hunks)
  • app/Jobs/GithubAppPermissionJob.php (1 hunks)
  • app/Jobs/PushServerUpdateJob.php (1 hunks)
  • app/Jobs/RegenerateSslCertJob.php (1 hunks)
  • app/Jobs/RestartProxyJob.php (2 hunks)
  • app/Jobs/ServerCheckJob.php (2 hunks)
  • app/Jobs/ServerCleanupMux.php (1 hunks)
  • app/Jobs/ServerConnectionCheckJob.php (1 hunks)
  • app/Jobs/ServerFilesFromServerJob.php (1 hunks)
  • app/Jobs/ServerLimitCheckJob.php (1 hunks)
  • app/Jobs/ServerStorageCheckJob.php (1 hunks)
  • app/Jobs/ServerStorageSaveJob.php (1 hunks)
  • app/Jobs/SubscriptionInvoiceFailedJob.php (1 hunks)
  • app/Jobs/VolumeCloneJob.php (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
app/**/*.php

📄 CodeRabbit inference engine (CLAUDE.md)

app/**/*.php: Always add explicit return type declarations for methods and functions
Use PHP 8 constructor property promotion in __construct() methods
Use curly braces for all control structures, even single-line statements
Use PHPDoc blocks instead of inline comments for documentation
Run vendor/bin/pint --dirty before finalizing code changes to ensure code matches project style

app/**/*.php: For database work, follow Eloquent ORM patterns, migration best practices, relationship definitions, and query optimization documented in .ai/patterns/database-patterns.md
For Laravel-specific development, follow patterns in .ai/development/laravel-boost.md including Laravel 12.4.1, Livewire 3 best practices, and Pest testing patterns

Files:

  • app/Jobs/ServerFilesFromServerJob.php
  • app/Actions/Application/IsHorizonQueueEmpty.php
  • app/Actions/Service/DeleteService.php
  • app/Jobs/SubscriptionInvoiceFailedJob.php
  • app/Actions/Database/StartDatabaseProxy.php
  • app/Actions/Service/StartService.php
  • app/Actions/Server/CheckUpdates.php
  • app/Jobs/CleanupStaleMultiplexedConnections.php
  • app/Actions/Server/RunCommand.php
  • app/Jobs/ServerConnectionCheckJob.php
  • app/Jobs/RestartProxyJob.php
  • app/Actions/Server/InstallPrerequisites.php
  • app/Actions/Application/LoadComposeFile.php
  • app/Actions/Application/StopApplicationOneServer.php
  • app/Actions/Database/StopDatabaseProxy.php
  • app/Jobs/GithubAppPermissionJob.php
  • app/Actions/Server/DeleteServer.php
  • app/Jobs/PushServerUpdateJob.php
  • app/Jobs/ServerStorageCheckJob.php
  • app/Actions/Server/StartSentinel.php
  • app/Actions/Application/GenerateConfig.php
  • app/Jobs/ServerStorageSaveJob.php
  • app/Actions/Database/RestartDatabase.php
  • app/Jobs/RegenerateSslCertJob.php
  • app/Actions/Server/StopLogDrain.php
  • app/Actions/Database/StartMysql.php
  • app/Actions/Server/ResourcesCheck.php
  • app/Actions/Service/StopService.php
  • app/Actions/Server/RestartContainer.php
  • app/Actions/Database/StartMariadb.php
  • app/Actions/Service/RestartService.php
  • app/Actions/Server/ValidateServer.php
  • app/Actions/Application/StopApplication.php
  • app/Jobs/ApplicationPullRequestUpdateJob.php
  • app/Jobs/ServerCheckJob.php
  • app/Jobs/ServerLimitCheckJob.php
  • app/Actions/Shared/ComplexStatusCheck.php
  • app/Actions/Server/CleanupDocker.php
  • app/Actions/Server/UpdateCoolify.php
  • app/Actions/Database/StartClickhouse.php
  • app/Actions/Database/StopDatabase.php
  • app/Actions/Database/StartDatabase.php
  • app/Actions/Proxy/StopProxy.php
  • app/Actions/Database/StartKeydb.php
  • app/Actions/Server/StopSentinel.php
  • app/Actions/Server/StartLogDrain.php
  • app/Actions/Database/StartRedis.php
  • app/Jobs/DeleteResourceJob.php
  • app/Actions/Database/StartDragonfly.php
  • app/Actions/Database/StartPostgresql.php
  • app/Actions/Database/StartMongodb.php
  • app/Jobs/ServerCleanupMux.php
  • app/Jobs/VolumeCloneJob.php
  • app/Actions/Server/InstallDocker.php
app/Jobs/**/*.php

📄 CodeRabbit inference engine (CLAUDE.md)

Use queued jobs for time-consuming operations with the ShouldQueue interface

Files:

  • app/Jobs/ServerFilesFromServerJob.php
  • app/Jobs/SubscriptionInvoiceFailedJob.php
  • app/Jobs/CleanupStaleMultiplexedConnections.php
  • app/Jobs/ServerConnectionCheckJob.php
  • app/Jobs/RestartProxyJob.php
  • app/Jobs/GithubAppPermissionJob.php
  • app/Jobs/PushServerUpdateJob.php
  • app/Jobs/ServerStorageCheckJob.php
  • app/Jobs/ServerStorageSaveJob.php
  • app/Jobs/RegenerateSslCertJob.php
  • app/Jobs/ApplicationPullRequestUpdateJob.php
  • app/Jobs/ServerCheckJob.php
  • app/Jobs/ServerLimitCheckJob.php
  • app/Jobs/DeleteResourceJob.php
  • app/Jobs/ServerCleanupMux.php
  • app/Jobs/VolumeCloneJob.php
**/*

📄 CodeRabbit inference engine (.cursor/rules/coolify-ai-docs.mdc)

Reference .ai/core/technology-stack.md as the SINGLE SOURCE OF TRUTH for all version numbers and dependencies (never duplicate versions elsewhere)

Files:

  • app/Jobs/ServerFilesFromServerJob.php
  • app/Actions/Application/IsHorizonQueueEmpty.php
  • app/Actions/Service/DeleteService.php
  • app/Jobs/SubscriptionInvoiceFailedJob.php
  • app/Actions/Database/StartDatabaseProxy.php
  • app/Actions/Service/StartService.php
  • app/Actions/Server/CheckUpdates.php
  • app/Jobs/CleanupStaleMultiplexedConnections.php
  • app/Actions/Server/RunCommand.php
  • app/Jobs/ServerConnectionCheckJob.php
  • app/Jobs/RestartProxyJob.php
  • app/Actions/Server/InstallPrerequisites.php
  • app/Actions/Application/LoadComposeFile.php
  • app/Actions/Application/StopApplicationOneServer.php
  • app/Actions/Database/StopDatabaseProxy.php
  • app/Jobs/GithubAppPermissionJob.php
  • app/Actions/Server/DeleteServer.php
  • app/Jobs/PushServerUpdateJob.php
  • app/Jobs/ServerStorageCheckJob.php
  • app/Actions/Server/StartSentinel.php
  • app/Actions/Application/GenerateConfig.php
  • app/Jobs/ServerStorageSaveJob.php
  • app/Actions/Database/RestartDatabase.php
  • app/Jobs/RegenerateSslCertJob.php
  • app/Actions/Server/StopLogDrain.php
  • app/Actions/Database/StartMysql.php
  • app/Actions/Server/ResourcesCheck.php
  • app/Actions/Service/StopService.php
  • app/Actions/Server/RestartContainer.php
  • app/Actions/Database/StartMariadb.php
  • app/Actions/Service/RestartService.php
  • app/Actions/Server/ValidateServer.php
  • app/Actions/Application/StopApplication.php
  • app/Jobs/ApplicationPullRequestUpdateJob.php
  • app/Jobs/ServerCheckJob.php
  • app/Jobs/ServerLimitCheckJob.php
  • app/Actions/Shared/ComplexStatusCheck.php
  • app/Actions/Server/CleanupDocker.php
  • app/Actions/Server/UpdateCoolify.php
  • app/Actions/Database/StartClickhouse.php
  • app/Actions/Database/StopDatabase.php
  • app/Actions/Database/StartDatabase.php
  • app/Actions/Proxy/StopProxy.php
  • app/Actions/Database/StartKeydb.php
  • app/Actions/Server/StopSentinel.php
  • app/Actions/Server/StartLogDrain.php
  • app/Actions/Database/StartRedis.php
  • app/Jobs/DeleteResourceJob.php
  • app/Actions/Database/StartDragonfly.php
  • app/Actions/Database/StartPostgresql.php
  • app/Actions/Database/StartMongodb.php
  • app/Jobs/ServerCleanupMux.php
  • app/Jobs/VolumeCloneJob.php
  • app/Actions/Server/InstallDocker.php
**/*.php

📄 CodeRabbit inference engine (.cursor/rules/coolify-ai-docs.mdc)

Always run ./vendor/bin/pint for code formatting before committing

Files:

  • app/Jobs/ServerFilesFromServerJob.php
  • app/Actions/Application/IsHorizonQueueEmpty.php
  • app/Actions/Service/DeleteService.php
  • app/Jobs/SubscriptionInvoiceFailedJob.php
  • app/Actions/Database/StartDatabaseProxy.php
  • app/Actions/Service/StartService.php
  • app/Actions/Server/CheckUpdates.php
  • app/Jobs/CleanupStaleMultiplexedConnections.php
  • app/Actions/Server/RunCommand.php
  • app/Jobs/ServerConnectionCheckJob.php
  • app/Jobs/RestartProxyJob.php
  • app/Actions/Server/InstallPrerequisites.php
  • app/Actions/Application/LoadComposeFile.php
  • app/Actions/Application/StopApplicationOneServer.php
  • app/Actions/Database/StopDatabaseProxy.php
  • app/Jobs/GithubAppPermissionJob.php
  • app/Actions/Server/DeleteServer.php
  • app/Jobs/PushServerUpdateJob.php
  • app/Jobs/ServerStorageCheckJob.php
  • app/Actions/Server/StartSentinel.php
  • app/Actions/Application/GenerateConfig.php
  • app/Jobs/ServerStorageSaveJob.php
  • app/Actions/Database/RestartDatabase.php
  • app/Jobs/RegenerateSslCertJob.php
  • app/Actions/Server/StopLogDrain.php
  • app/Actions/Database/StartMysql.php
  • app/Actions/Server/ResourcesCheck.php
  • app/Actions/Service/StopService.php
  • app/Actions/Server/RestartContainer.php
  • app/Actions/Database/StartMariadb.php
  • app/Actions/Service/RestartService.php
  • app/Actions/Server/ValidateServer.php
  • app/Actions/Application/StopApplication.php
  • app/Jobs/ApplicationPullRequestUpdateJob.php
  • app/Jobs/ServerCheckJob.php
  • app/Jobs/ServerLimitCheckJob.php
  • app/Actions/Shared/ComplexStatusCheck.php
  • app/Actions/Server/CleanupDocker.php
  • app/Actions/Server/UpdateCoolify.php
  • app/Actions/Database/StartClickhouse.php
  • app/Actions/Database/StopDatabase.php
  • app/Actions/Database/StartDatabase.php
  • app/Actions/Proxy/StopProxy.php
  • app/Actions/Database/StartKeydb.php
  • app/Actions/Server/StopSentinel.php
  • app/Actions/Server/StartLogDrain.php
  • app/Actions/Database/StartRedis.php
  • app/Jobs/DeleteResourceJob.php
  • app/Actions/Database/StartDragonfly.php
  • app/Actions/Database/StartPostgresql.php
  • app/Actions/Database/StartMongodb.php
  • app/Jobs/ServerCleanupMux.php
  • app/Jobs/VolumeCloneJob.php
  • app/Actions/Server/InstallDocker.php
app/Actions/**/*.php

📄 CodeRabbit inference engine (CLAUDE.md)

Use Actions pattern for complex business logic in app/Actions/ directory

Files:

  • app/Actions/Application/IsHorizonQueueEmpty.php
  • app/Actions/Service/DeleteService.php
  • app/Actions/Database/StartDatabaseProxy.php
  • app/Actions/Service/StartService.php
  • app/Actions/Server/CheckUpdates.php
  • app/Actions/Server/RunCommand.php
  • app/Actions/Server/InstallPrerequisites.php
  • app/Actions/Application/LoadComposeFile.php
  • app/Actions/Application/StopApplicationOneServer.php
  • app/Actions/Database/StopDatabaseProxy.php
  • app/Actions/Server/DeleteServer.php
  • app/Actions/Server/StartSentinel.php
  • app/Actions/Application/GenerateConfig.php
  • app/Actions/Database/RestartDatabase.php
  • app/Actions/Server/StopLogDrain.php
  • app/Actions/Database/StartMysql.php
  • app/Actions/Server/ResourcesCheck.php
  • app/Actions/Service/StopService.php
  • app/Actions/Server/RestartContainer.php
  • app/Actions/Database/StartMariadb.php
  • app/Actions/Service/RestartService.php
  • app/Actions/Server/ValidateServer.php
  • app/Actions/Application/StopApplication.php
  • app/Actions/Shared/ComplexStatusCheck.php
  • app/Actions/Server/CleanupDocker.php
  • app/Actions/Server/UpdateCoolify.php
  • app/Actions/Database/StartClickhouse.php
  • app/Actions/Database/StopDatabase.php
  • app/Actions/Database/StartDatabase.php
  • app/Actions/Proxy/StopProxy.php
  • app/Actions/Database/StartKeydb.php
  • app/Actions/Server/StopSentinel.php
  • app/Actions/Server/StartLogDrain.php
  • app/Actions/Database/StartRedis.php
  • app/Actions/Database/StartDragonfly.php
  • app/Actions/Database/StartPostgresql.php
  • app/Actions/Database/StartMongodb.php
  • app/Actions/Server/InstallDocker.php
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: johnproblems/topgun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-03T15:49:39.698Z
Learning: Applies to app/**/*.php : Always add explicit return type declarations for methods and functions
📚 Learning: 2025-12-03T15:49:39.698Z
Learnt from: CR
Repo: johnproblems/topgun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-03T15:49:39.698Z
Learning: Applies to app/**/*.php : Always add explicit return type declarations for methods and functions

Applied to files:

  • app/Jobs/ServerFilesFromServerJob.php
  • app/Actions/Application/IsHorizonQueueEmpty.php
  • app/Jobs/ServerConnectionCheckJob.php
  • app/Jobs/GithubAppPermissionJob.php
  • app/Actions/Application/GenerateConfig.php
  • app/Jobs/ServerStorageSaveJob.php
  • app/Jobs/RegenerateSslCertJob.php
  • app/Jobs/ServerLimitCheckJob.php
  • app/Actions/Shared/ComplexStatusCheck.php
  • app/Actions/Server/UpdateCoolify.php
  • app/Actions/Database/StartClickhouse.php
📚 Learning: 2025-12-03T15:49:39.698Z
Learnt from: CR
Repo: johnproblems/topgun PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-03T15:49:39.698Z
Learning: Applies to app/Services/Enterprise/**/*.php : Implement the CapacityManager pattern with canServerHandleDeployment() and selectOptimalServer() methods for capacity-aware deployment decisions

Applied to files:

  • app/Actions/Application/StopApplication.php
🧬 Code graph analysis (36)
app/Jobs/ServerFilesFromServerJob.php (3)
app/Actions/Application/IsHorizonQueueEmpty.php (1)
  • handle (12-36)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Actions/Application/StopApplicationOneServer.php (1)
  • handle (13-42)
app/Actions/Service/DeleteService.php (2)
app/Actions/Service/StopService.php (1)
  • handle (17-52)
app/Jobs/DeleteResourceJob.php (1)
  • handle (43-114)
app/Actions/Service/StartService.php (2)
app/Actions/Database/StartMariadb.php (1)
  • handle (24-222)
app/Actions/Database/StartMysql.php (1)
  • handle (24-225)
app/Actions/Server/CheckUpdates.php (2)
app/Actions/Application/GenerateConfig.php (1)
  • handle (12-15)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Jobs/CleanupStaleMultiplexedConnections.php (1)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Actions/Server/RunCommand.php (2)
app/Actions/Database/StartMysql.php (1)
  • handle (24-225)
app/Actions/Database/StartRedis.php (1)
  • handle (25-215)
app/Jobs/ServerConnectionCheckJob.php (13)
app/Actions/Application/GenerateConfig.php (1)
  • handle (12-15)
app/Actions/Application/IsHorizonQueueEmpty.php (1)
  • handle (12-36)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Actions/Application/StopApplication.php (1)
  • handle (16-61)
app/Actions/Application/StopApplicationOneServer.php (1)
  • handle (13-42)
app/Actions/Database/RestartDatabase.php (1)
  • handle (20-29)
app/Actions/Database/StartClickhouse.php (1)
  • handle (20-115)
app/Actions/Database/StartDatabase.php (1)
  • handle (22-59)
app/Actions/Database/StartDatabaseProxy.php (1)
  • handle (23-123)
app/Actions/Database/StartMariadb.php (1)
  • handle (24-222)
app/Actions/Database/StartMongodb.php (1)
  • handle (24-273)
app/Actions/Server/DeleteServer.php (1)
  • handle (16-50)
app/Jobs/ServerManagerJob.php (1)
  • handle (41-63)
app/Jobs/RestartProxyJob.php (2)
app/Actions/Proxy/StopProxy.php (1)
  • handle (15-50)
bootstrap/helpers/shared.php (1)
  • handleError (191-225)
app/Actions/Server/InstallPrerequisites.php (3)
app/Actions/Database/StartDatabase.php (1)
  • handle (22-59)
app/Actions/Database/StartDragonfly.php (1)
  • handle (24-202)
app/Actions/Server/InstallDocker.php (1)
  • handle (17-114)
app/Actions/Application/LoadComposeFile.php (13)
app/Actions/Application/GenerateConfig.php (1)
  • handle (12-15)
app/Actions/Application/StopApplication.php (1)
  • handle (16-61)
app/Actions/Application/StopApplicationOneServer.php (1)
  • handle (13-42)
app/Actions/Database/RestartDatabase.php (1)
  • handle (20-29)
app/Actions/Database/StartClickhouse.php (1)
  • handle (20-115)
app/Actions/Database/StartDatabaseProxy.php (1)
  • handle (23-123)
app/Actions/Database/StartDragonfly.php (1)
  • handle (24-202)
app/Actions/Database/StartKeydb.php (1)
  • handle (25-218)
app/Actions/Database/StartMariadb.php (1)
  • handle (24-222)
app/Actions/Database/StartMongodb.php (1)
  • handle (24-273)
app/Actions/Database/StartMysql.php (1)
  • handle (24-225)
app/Actions/Database/StartPostgresql.php (1)
  • handle (26-236)
app/Actions/Database/StartRedis.php (1)
  • handle (25-215)
app/Actions/Application/StopApplicationOneServer.php (2)
app/Actions/Application/StopApplication.php (1)
  • handle (16-61)
app/Models/Server.php (1)
  • isSwarm (1086-1089)
app/Actions/Database/StopDatabaseProxy.php (2)
app/Actions/Database/RestartDatabase.php (1)
  • handle (20-29)
app/Actions/Database/StartDatabaseProxy.php (1)
  • handle (23-123)
app/Jobs/GithubAppPermissionJob.php (2)
app/Actions/Application/GenerateConfig.php (1)
  • handle (12-15)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Actions/Application/GenerateConfig.php (3)
app/Actions/Application/StopApplication.php (1)
  • handle (16-61)
app/Actions/Database/StartDatabase.php (1)
  • handle (22-59)
app/Actions/Database/StartMysql.php (1)
  • handle (24-225)
app/Jobs/ServerStorageSaveJob.php (1)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Jobs/RegenerateSslCertJob.php (1)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Actions/Database/StartMysql.php (2)
app/Actions/Database/StartClickhouse.php (3)
  • generate_local_persistent_volumes (120-133)
  • generate_local_persistent_volumes_only_volume_names (138-153)
  • generate_environment_variables (158-176)
app/Actions/Database/StartMariadb.php (4)
  • generate_local_persistent_volumes (227-240)
  • generate_local_persistent_volumes_only_volume_names (245-260)
  • generate_environment_variables (265-290)
  • add_custom_mysql (292-301)
app/Actions/Server/ResourcesCheck.php (1)
bootstrap/helpers/shared.php (1)
  • handleError (191-225)
app/Actions/Service/StopService.php (2)
app/Actions/Service/DeleteService.php (1)
  • handle (14-77)
app/Jobs/DeleteResourceJob.php (1)
  • handle (43-114)
app/Actions/Server/RestartContainer.php (2)
app/Actions/Application/IsHorizonQueueEmpty.php (1)
  • handle (12-36)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Actions/Service/RestartService.php (4)
app/Actions/Database/RestartDatabase.php (1)
  • handle (20-29)
app/Actions/Database/StartMysql.php (1)
  • handle (24-225)
app/Actions/Database/StartPostgresql.php (1)
  • handle (26-236)
app/Actions/Database/StartRedis.php (1)
  • handle (25-215)
app/Actions/Server/ValidateServer.php (2)
app/Actions/Server/ValidatePrerequisites.php (1)
  • handle (19-39)
app/Jobs/ValidateAndInstallServerJob.php (1)
  • handle (32-197)
app/Jobs/ApplicationPullRequestUpdateJob.php (3)
app/Actions/Application/IsHorizonQueueEmpty.php (1)
  • handle (12-36)
app/Actions/Application/StopApplicationOneServer.php (1)
  • handle (13-42)
app/Actions/Database/StartPostgresql.php (1)
  • handle (26-236)
app/Jobs/ServerCheckJob.php (2)
app/Models/Server.php (2)
  • isSwarmWorker (1096-1099)
  • isBuildServer (1356-1359)
bootstrap/helpers/shared.php (1)
  • handleError (191-225)
app/Jobs/ServerLimitCheckJob.php (2)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Actions/Database/StartDatabaseProxy.php (1)
  • handle (23-123)
app/Actions/Shared/ComplexStatusCheck.php (2)
app/Actions/Application/GenerateConfig.php (1)
  • handle (12-15)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Actions/Server/CleanupDocker.php (3)
app/Actions/Database/StopDatabase.php (1)
  • handle (21-46)
app/Actions/Service/StopService.php (1)
  • handle (17-52)
app/Jobs/DockerCleanupJob.php (1)
  • handle (44-147)
app/Actions/Database/StopDatabase.php (2)
app/Actions/Application/StopApplication.php (1)
  • handle (16-61)
app/Actions/Service/StopService.php (1)
  • handle (17-52)
app/Actions/Database/StartDatabase.php (7)
app/Actions/Database/RestartDatabase.php (1)
  • handle (20-29)
app/Actions/Database/StartClickhouse.php (1)
  • handle (20-115)
app/Actions/Database/StartMariadb.php (1)
  • handle (24-222)
app/Actions/Database/StartMongodb.php (1)
  • handle (24-273)
app/Actions/Database/StartMysql.php (1)
  • handle (24-225)
app/Actions/Database/StartPostgresql.php (1)
  • handle (26-236)
app/Actions/Database/StartRedis.php (1)
  • handle (25-215)
app/Actions/Proxy/StopProxy.php (2)
app/Jobs/RestartProxyJob.php (1)
  • handle (31-44)
bootstrap/helpers/shared.php (1)
  • handleError (191-225)
app/Actions/Server/StopSentinel.php (1)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Actions/Server/StartLogDrain.php (2)
app/Actions/Database/StartMysql.php (1)
  • handle (24-225)
app/Actions/Server/InstallDocker.php (1)
  • handle (17-114)
app/Actions/Database/StartDragonfly.php (4)
app/Actions/Database/StartClickhouse.php (2)
  • handle (20-115)
  • generate_local_persistent_volumes (120-133)
app/Actions/Database/StartMysql.php (2)
  • handle (24-225)
  • generate_local_persistent_volumes (230-243)
app/Actions/Database/StartPostgresql.php (2)
  • handle (26-236)
  • generate_local_persistent_volumes (241-254)
app/Models/StandaloneDragonfly.php (1)
  • StandaloneDragonfly (22-377)
app/Jobs/ServerCleanupMux.php (2)
app/Helpers/SshMultiplexingHelper.php (2)
  • SshMultiplexingHelper (12-311)
  • removeMuxFile (95-109)
bootstrap/helpers/shared.php (1)
  • handleError (191-225)
app/Jobs/VolumeCloneJob.php (2)
app/Actions/Application/IsHorizonQueueEmpty.php (1)
  • handle (12-36)
app/Actions/Application/LoadComposeFile.php (1)
  • handle (12-15)
app/Actions/Server/InstallDocker.php (2)
app/Actions/Server/InstallPrerequisites.php (1)
  • handle (15-57)
app/Actions/Server/StartLogDrain.php (1)
  • handle (15-221)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Cursor Bugbot

@johnproblems johnproblems merged commit 54a91da into phpstan-path-day-2 Dec 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants