Skip to content

Run composer update and update model phpdocs#2275

Open
Boy132 wants to merge 6 commits intomainfrom
boy132/composer-update
Open

Run composer update and update model phpdocs#2275
Boy132 wants to merge 6 commits intomainfrom
boy132/composer-update

Conversation

@Boy132
Copy link
Member

@Boy132 Boy132 commented Mar 12, 2026

Supersedes #2274

@Boy132 Boy132 self-assigned this Mar 12, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8e638758-fa1e-44d9-878d-6559abde88e6

📥 Commits

Reviewing files that changed from the base of the PR and between 7c54665 and 32d6151.

📒 Files selected for processing (2)
  • app/Models/Backup.php
  • app/Models/File.php

📝 Walkthrough

Walkthrough

Systematic namespace/import and PHPDoc standardization across the codebase: replaced fully-qualified class names with imports, migrated Carbon imports to Illuminate\Support\Carbon, enriched model docblocks with generics/read-only annotations, adjusted a few method signatures and frontend component parameter names, and bumped Composer dependency versions. No substantive runtime logic changes.

Changes

Cohort / File(s) Summary
Filament pages & resources
app/Filament/Admin/Pages/ListLogs.php, app/Filament/Admin/Resources/Nodes/Pages/EditNode.php, app/Filament/Admin/Resources/Servers/Pages/EditServer.php, app/Filament/Server/Pages/Settings.php, app/Filament/Server/Resources/Activities/ActivityResource.php, app/Filament/Server/Resources/Files/Pages/EditFiles.php
Shortened type annotations via imports (e.g., Htmlable, View), normalized exception references to imported Exception, added a PHPDoc return annotation, and added an optional ?string $configuration parameter to EditFiles::getUrl.
Livewire / Helpers / HTTP
app/Livewire/NodeClientConnectivity.php, app/helpers.php, app/Http/Middleware/RequireTwoFactorAuthentication.php, app/Http/Requests/Api/Application/ApplicationApiRequest.php
Switched return/type PHPDocs to use imported aliases, added phpstan-ignore in one request helper, and changed the user() helper signature to return ?User via import.
Model docblocks (bulk)
app/Models/* (many files, e.g., ActivityLog, Allocation, ApiKey, Backup, Database, Egg, Node, Server, etc.)
Extensive PHPDoc updates: switch to Illuminate\Support\Carbon, add/adjust @property/@property-read, add @method builder/factory stubs with Builder<static> generics, refine array types, mark relations read-only; one allocation docblock removed ip_alias/notes. No runtime logic changes.
Providers / Services / Bootstrap
app/Providers/AppServiceProvider.php, app/Services/Databases/DatabaseManagementService.php, app/Services/Helpers/PluginService.php, bootstrap/app.php, bootstrap/providers.php
Replaced fully-qualified references with imported aliases (e.g., LoginResponse, Filament, Kernel, Handler), updated provider registrations and singleton mappings, and aligned @throws docblocks to imported Exception.
Config files
config/database.php, config/fractal.php, config/health.php, config/permission.php, config/sanctum.php
Added/used imports and replaced fully-qualified class names with imported aliases in config arrays (PDO/Mysql ATTR_SSL_CA, Fractal serializer, Spatie Health/Permission/Sanctum references).
Migrations
database/migrations/* (multiple files)
Replaced fully-qualified names in docblocks and bodies with imported aliases (Exception/Throwable, Str, WebhookConfiguration); no signature or runtime logic changes.
Composer & static analysis
composer.json, phpstan.neon
Bumped multiple dependency version constraints and set treatPhpDocTypesAsCertain: false in phpstan.neon.
Frontend JS
public/js/filament/... (app.js, color-picker.js, notifications.js, schemas/components/tabs.js, wizard.js)
Minor minified updates; renamed default exports/parameter destructuring for tabs and wizard components and introduced autofocus behavior in tabs/wizard. These JS components' exported parameter names/signatures changed.
Tests & test helpers
tests/**/*, tests/Pest.php, tests/Traits/*
Replaced fully-qualified PHPDoc annotations with imported aliases, added necessary use statements, adjusted some docblock exception/return annotations and a Closure return type; no test logic changes.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.87% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the two main objectives: running composer update and updating model PHPDocs, which are the primary changes throughout the changeset.
Description check ✅ Passed The description references superseding PR #2274 and is related to the changeset, though it provides minimal detail about the actual changes being made.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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: 10

Caution

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

⚠️ Outside diff range comments (1)
app/Models/Server.php (1)

511-511: ⚠️ Potential issue | 🟡 Minor

Potential bug: Bitwise AND instead of logical AND.

Line 511 uses & (bitwise AND) instead of && (logical AND). While this may produce the same result in this specific boolean context, it's likely unintentional and should be corrected for clarity.

🔧 Proposed fix
-        if ($resourceAmount === 0 & $resourceType->isLimit()) {
+        if ($resourceAmount === 0 && $resourceType->isLimit()) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/Models/Server.php` at line 511, Change the bitwise AND to a logical AND
in the conditional that checks resource amount and limit: replace the use of `&`
in the expression involving `$resourceAmount` and `$resourceType->isLimit()`
with `&&` so the condition uses logical conjunction (e.g., in the if statement
that contains `$resourceAmount` and `$resourceType->isLimit()`).
🧹 Nitpick comments (5)
tests/Integration/Services/Servers/ServerCreationServiceTest.php (1)

60-60: Tighten the $allocations PHPDoc type.

Allocation::factory()->times(5)->create() returns an Eloquent collection here, not Allocation[]|Collection. This union widens the type and drops the element generic, so PHPStan gets less value from the annotation than it could. Prefer a concrete generic collection type instead.

♻️ Proposed fix
-use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Database\Eloquent\Collection as EloquentCollection;
...
-        /** `@var` Allocation[]|Collection $allocations */
+        /** `@var` EloquentCollection<int, Allocation> $allocations */
         $allocations = Allocation::factory()->times(5)->create([
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Integration/Services/Servers/ServerCreationServiceTest.php` at line 60,
Update the PHPDoc for $allocations to a concrete generic Eloquent collection
type instead of the loose Allocation[]|Collection union; replace the current doc
with something like `@var` \Illuminate\Database\Eloquent\Collection<int,
\App\Models\Allocation> $allocations (or import the Eloquent Collection class
and use Collection<int, Allocation>) to reflect the result of
Allocation::factory()->times(5)->create() and give PHPStan the element type.
app/Models/ActivityLog.php (1)

34-34: Keep $properties nullable in the PHPDoc.

The model still treats $this->properties as nullable in both wrapProperties() and hasAdditionalMetadata(), so Line 34 currently overstates the guarantee.

Suggested change
- * `@property` Collection<array-key, mixed> $properties
+ * `@property` Collection<array-key, mixed>|null $properties
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/Models/ActivityLog.php` at line 34, Update the PHPDoc for the $properties
property to indicate it can be null (e.g., Collection<array-key, mixed>|null or
?Collection<array-key, mixed>) because the model code (see wrapProperties() and
hasAdditionalMetadata() methods) still treats $this->properties as nullable;
change the doc comment on the $properties property in the ActivityLog class to
reflect nullable type so the doc matches runtime behavior.
tests/Integration/Services/Schedules/ProcessScheduleServiceTest.php (1)

100-101: Fix the inline @var target on Line 100.

This annotation is attached to $task2, not $task, so the variable name in the PHPDoc is misleading.

Suggested change
-        /** `@var` Task $task */
+        /** `@var` Task $task2 */
         $task2 = Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 4]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Integration/Services/Schedules/ProcessScheduleServiceTest.php` around
lines 100 - 101, The PHPDoc `@var` annotation on the line above
Task::factory()->create incorrectly references $task but is meant for $task2;
update the inline doc to target $task2 (e.g., change the variable name in the
`@var` comment) so the annotation accurately describes the variable created by
Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 4])
and references the Task class.
tests/Traits/Integration/CreatesTestModels.php (1)

102-103: Prefer refresh() over asserting away fresh() here.

Line 102 is masking the nullable return from fresh() right before Line 106 dereferences $model->id. refresh() keeps the persisted Egg instance and avoids the extra PHPDoc assertion.

Suggested change
-        /** `@var` Egg $model */
-        $model = $model->fresh();
+        $model->refresh();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Traits/Integration/CreatesTestModels.php` around lines 102 - 103, The
test uses $model = $model->fresh() which returns ?Egg and forces a PHPDoc
assertion later; replace that with the instance method refresh() to update the
existing persisted Egg in place (i.e. call $model->refresh() on the Egg
instance) and remove the nullable/extra PHPDoc assertion so the subsequent
dereference of $model->id is safe and not masking a nullable return from
fresh().
app/Models/ActivityLogSubject.php (1)

20-20: Make $subject nullable in the PHPDoc.

subject() is a MorphTo, so it can resolve to null when the target row no longer exists. The new annotation is stricter than the runtime contract.

Suggested change
- * `@property-read` Model|\Eloquent $subject
+ * `@property-read` Model|\Eloquent|null $subject
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/Models/ActivityLogSubject.php` at line 20, Update the class PHPDoc for
ActivityLogSubject to mark the subject property as nullable: change the
`@property-read` annotation for $subject (which is returned by the subject()
MorphTo relation) to include null (e.g., `@property-read` Model|\Eloquent|null
$subject) so the docblock matches the runtime behavior when the related model
can be absent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/Models/Allocation.php`:
- Line 27: Update the PHPDoc for the Allocation model to type the $address
property as string instead of mixed to match the accessor's return type; replace
the `@property-read` mixed $address entry with `@property-read` string $address so
it aligns with the Attribute<string, never> declared in the accessor on the
Allocation class.

In `@app/Models/Backup.php`:
- Line 34: Update the PHPDoc for the Backup model so the `@property-read` for
$status is typed as the BackupStatus enum instead of mixed; locate the Backup
class PHPDoc (the `@property-read` $status entry) and change its type to
BackupStatus to match the enum returned by the getStatusAttribute accessor (the
method around lines 111-115), ensuring static analysis recognizes the enum type.

In `@app/Models/EggVariable.php`:
- Line 23: The `@property` PHPDoc for $rules is incorrectly typed as array<string,
string>; update the doc to reflect that $rules is a list of rule names (e.g.
array<int, string> or string[]) so it matches how validation and
getRequiredAttribute() treat it; locate the $rules property in EggVariable.php
and adjust its PHPDoc accordingly to a string-list type.

In `@app/Models/File.php`:
- Around line 27-29: Update the PHPDoc for the File model to use bool|null for
the three file-type flags instead of int|null: change the `@property` annotations
for is_directory, is_file, and is_symlink to bool|null to match their
declarations in getSchema() and how they are hydrated in getRows(); ensure the
PHPDoc comments near the File class include these exact property names so static
analyzers see the correct types.

In `@app/Models/Schedule.php`:
- Line 35: The PHPDoc for the Schedule model incorrectly types the $status
accessor as mixed; update the docblock to use the ScheduleStatus enum (e.g.
`@property-read` \App\Enums\ScheduleStatus $status) because the accessor on the
Schedule class returns the enum directly; locate the Schedule model PHPDoc (the
`@property-read` $status line) and replace mixed with the ScheduleStatus enum
reference to preserve precise static typing.

In `@app/Models/WebhookConfiguration.php`:
- Line 20: The PHPDoc for the WebhookConfiguration::$events property was widened
to array<array-key,mixed> but the class (methods booted() and updateCache())
treats each element as an event name string; change the docblock back to a
string-list type (e.g. array<int,string> or string[] / list<string>) on the
$events property in the WebhookConfiguration class so callers and static
analysis know each element is a string.

In `@app/Services/Helpers/PluginService.php`:
- Around line 351-354: Remove the stale comment "This throws an error when not
called with qualifier" above the Filament::getPanels() loop in PluginService
(the loop that calls $panel->clearCachedComponents()); it no longer applies
because the unqualified Filament::getPanels() call is valid (as used earlier in
installPlugin()), so delete that comment to avoid confusion and leave the
foreach (Filament::getPanels() as $panel) { $panel->clearCachedComponents(); }
block unchanged.

In `@public/js/filament/schemas/components/wizard.js`:
- Line 1: The init() in the exported p() component always seeds this.step from
startStep (param o) causing query-string persistence
(isStepPersistedInQueryString / n) to be ignored; change init() so when n is
true it reads the step value from the URL using stepQueryStringKey (h),
validates it against getSteps(), and uses that value (falling back to startStep
if missing/invalid), then proceed to set up the $watch for "step", call
autofocusFields(), and keep updateQueryString() as-is so reloads/deep-links
respect the URL; update the logic in the init function inside p to prefer the
query string when present and valid.

In `@tests/Assertions/AssertsActivityLogged.php`:
- Around line 13-16: The PHPDoc for assertActivityFor is out of sync: it
documents a single $subjects parameter but the method signature uses a variadic
...$subjects. Update the docblock to reflect the variadic parameter (e.g.,
document as `@param` Model|array ...$subjects or `@param` (Model|array)[] $subjects
variadic) so it matches the function signature for assertActivityFor.

In `@tests/Integration/Services/Servers/BuildModificationServiceTest.php`:
- Around line 37-38: The docblock for $allocations is incorrect: replace the
array type with the Eloquent collection type returned by
Allocation::factory()->times(4)->create(...) by annotating $allocations as
Collection<int, Allocation> (or \Illuminate\Database\Eloquent\Collection<int,
Allocation>) so static analyzers and IDEs understand that $allocations is a
collection rather than an array; update the docblock above the $allocations
variable accordingly.

---

Outside diff comments:
In `@app/Models/Server.php`:
- Line 511: Change the bitwise AND to a logical AND in the conditional that
checks resource amount and limit: replace the use of `&` in the expression
involving `$resourceAmount` and `$resourceType->isLimit()` with `&&` so the
condition uses logical conjunction (e.g., in the if statement that contains
`$resourceAmount` and `$resourceType->isLimit()`).

---

Nitpick comments:
In `@app/Models/ActivityLog.php`:
- Line 34: Update the PHPDoc for the $properties property to indicate it can be
null (e.g., Collection<array-key, mixed>|null or ?Collection<array-key, mixed>)
because the model code (see wrapProperties() and hasAdditionalMetadata()
methods) still treats $this->properties as nullable; change the doc comment on
the $properties property in the ActivityLog class to reflect nullable type so
the doc matches runtime behavior.

In `@app/Models/ActivityLogSubject.php`:
- Line 20: Update the class PHPDoc for ActivityLogSubject to mark the subject
property as nullable: change the `@property-read` annotation for $subject (which
is returned by the subject() MorphTo relation) to include null (e.g.,
`@property-read` Model|\Eloquent|null $subject) so the docblock matches the
runtime behavior when the related model can be absent.

In `@tests/Integration/Services/Schedules/ProcessScheduleServiceTest.php`:
- Around line 100-101: The PHPDoc `@var` annotation on the line above
Task::factory()->create incorrectly references $task but is meant for $task2;
update the inline doc to target $task2 (e.g., change the variable name in the
`@var` comment) so the annotation accurately describes the variable created by
Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 4])
and references the Task class.

In `@tests/Integration/Services/Servers/ServerCreationServiceTest.php`:
- Line 60: Update the PHPDoc for $allocations to a concrete generic Eloquent
collection type instead of the loose Allocation[]|Collection union; replace the
current doc with something like `@var`
\Illuminate\Database\Eloquent\Collection<int, \App\Models\Allocation>
$allocations (or import the Eloquent Collection class and use Collection<int,
Allocation>) to reflect the result of Allocation::factory()->times(5)->create()
and give PHPStan the element type.

In `@tests/Traits/Integration/CreatesTestModels.php`:
- Around line 102-103: The test uses $model = $model->fresh() which returns ?Egg
and forces a PHPDoc assertion later; replace that with the instance method
refresh() to update the existing persisted Egg in place (i.e. call
$model->refresh() on the Egg instance) and remove the nullable/extra PHPDoc
assertion so the subsequent dereference of $model->id is safe and not masking a
nullable return from fresh().

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1aaed3c2-d591-4a8b-9a85-a454cc82c1ca

📥 Commits

Reviewing files that changed from the base of the PR and between 761492d and a218315.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (95)
  • app/Filament/Admin/Pages/ListLogs.php
  • app/Filament/Admin/Resources/Nodes/Pages/EditNode.php
  • app/Filament/Admin/Resources/Servers/Pages/EditServer.php
  • app/Filament/Server/Pages/Settings.php
  • app/Filament/Server/Resources/Activities/ActivityResource.php
  • app/Filament/Server/Resources/Files/Pages/EditFiles.php
  • app/Http/Middleware/RequireTwoFactorAuthentication.php
  • app/Http/Requests/Api/Application/ApplicationApiRequest.php
  • app/Livewire/NodeClientConnectivity.php
  • app/Models/ActivityLog.php
  • app/Models/ActivityLogSubject.php
  • app/Models/Allocation.php
  • app/Models/ApiKey.php
  • app/Models/Backup.php
  • app/Models/Database.php
  • app/Models/DatabaseHost.php
  • app/Models/Egg.php
  • app/Models/EggVariable.php
  • app/Models/File.php
  • app/Models/Mount.php
  • app/Models/Node.php
  • app/Models/NodeRole.php
  • app/Models/Plugin.php
  • app/Models/Role.php
  • app/Models/Schedule.php
  • app/Models/Server.php
  • app/Models/ServerTransfer.php
  • app/Models/ServerVariable.php
  • app/Models/Subuser.php
  • app/Models/Task.php
  • app/Models/Traits/HasAccessTokens.php
  • app/Models/User.php
  • app/Models/UserSSHKey.php
  • app/Models/Webhook.php
  • app/Models/WebhookConfiguration.php
  • app/Providers/AppServiceProvider.php
  • app/Services/Databases/DatabaseManagementService.php
  • app/Services/Helpers/PluginService.php
  • app/helpers.php
  • bootstrap/app.php
  • bootstrap/providers.php
  • composer.json
  • config/database.php
  • config/fractal.php
  • config/health.php
  • config/permission.php
  • config/sanctum.php
  • database/migrations/2018_01_13_142012_SetupTableForKeyEncryption.php
  • database/migrations/2018_02_25_160152_remove_default_null_value_on_table.php
  • database/migrations/2020_04_10_141024_store_node_tokens_as_encrypted_value.php
  • database/migrations/2023_01_24_210051_add_uuid_column_to_failed_jobs_table.php
  • database/migrations/2024_04_21_162552_create_webhooks_table.php
  • database/migrations/2024_07_19_130942_create_permission_tables.php
  • phpstan.neon
  • public/css/filament/filament/app.css
  • public/js/filament/filament/app.js
  • public/js/filament/forms/components/color-picker.js
  • public/js/filament/forms/components/select.js
  • public/js/filament/notifications/notifications.js
  • public/js/filament/schemas/components/tabs.js
  • public/js/filament/schemas/components/wizard.js
  • public/js/filament/support/support.js
  • public/js/filament/tables/components/columns/select.js
  • tests/Assertions/AssertsActivityLogged.php
  • tests/Feature/SettingsControllerTest.php
  • tests/Integration/Api/Client/AccountControllerTest.php
  • tests/Integration/Api/Client/ApiKeyControllerTest.php
  • tests/Integration/Api/Client/ClientControllerTest.php
  • tests/Integration/Api/Client/Server/Allocation/CreateNewAllocationTest.php
  • tests/Integration/Api/Client/Server/Allocation/DeleteAllocationTest.php
  • tests/Integration/Api/Client/Server/Backup/DeleteBackupTest.php
  • tests/Integration/Api/Client/Server/Schedule/CreateServerScheduleTest.php
  • tests/Integration/Api/Client/Server/Schedule/ExecuteScheduleTest.php
  • tests/Integration/Api/Client/Server/Schedule/GetServerSchedulesTest.php
  • tests/Integration/Api/Client/Server/Schedule/UpdateServerScheduleTest.php
  • tests/Integration/Api/Client/Server/ScheduleTask/CreateServerScheduleTaskTest.php
  • tests/Integration/Api/Client/Server/SettingsControllerTest.php
  • tests/Integration/Api/Client/Server/Startup/GetStartupAndVariablesTest.php
  • tests/Integration/Api/Client/Server/Startup/UpdateStartupVariableTest.php
  • tests/Integration/Api/Client/Server/Subuser/CreateServerSubuserTest.php
  • tests/Integration/Api/Client/Server/Subuser/DeleteSubuserTest.php
  • tests/Integration/Api/Client/Server/Subuser/SubuserAuthorizationTest.php
  • tests/Integration/Api/Client/Server/Subuser/UpdateSubuserTest.php
  • tests/Integration/Api/Client/Server/WebsocketControllerTest.php
  • tests/Integration/Api/Daemon/DaemonAuthenticateTest.php
  • tests/Integration/Jobs/Schedule/RunTaskJobTest.php
  • tests/Integration/Services/Schedules/ProcessScheduleServiceTest.php
  • tests/Integration/Services/Servers/BuildModificationServiceTest.php
  • tests/Integration/Services/Servers/ServerCreationServiceTest.php
  • tests/Integration/Services/Servers/ServerDeletionServiceTest.php
  • tests/Integration/Services/Servers/StartupModificationServiceTest.php
  • tests/Pest.php
  • tests/Traits/Http/MocksMiddlewareClosure.php
  • tests/Traits/Integration/CreatesTestModels.php
  • tests/Traits/MocksPdoConnection.php

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.

♻️ Duplicate comments (1)
app/Models/File.php (1)

27-29: ⚠️ Potential issue | 🟡 Minor

Keep these file-type flags documented as booleans.

Lines 27-29 still regress is_directory, is_file, and is_symlink to int, but getSchema() declares them as boolean and the rest of the codebase uses them as boolean flags. This leaves the PHPDoc misleading for static analysis and IDE help.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/Models/File.php` around lines 27 - 29, Update the PHPDoc for the File
model so the file-type flags are documented as booleans: change the PHPDoc types
for is_directory, is_file, and is_symlink from int to bool to match getSchema()
and how the rest of the codebase uses them; locate the docblock containing those
`@property` annotations in the File class and replace the int types with boolean
(or bool) to keep static analysis and IDE hints correct.
🧹 Nitpick comments (1)
app/Models/Backup.php (1)

22-22: Consider narrowing $ignored_files type for better static analysis.

The ignored_files property is used with implode("\n", $backup->ignored_files) in DaemonBackupRepository, which expects string elements. The widened type array<array-key, mixed> loses this guarantee.

✏️ Suggested type narrowing
- * `@property` array<array-key, mixed> $ignored_files
+ * `@property` string[] $ignored_files
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/Models/Backup.php` at line 22, The property docblock for
Backup::$ignored_files is too broad; change its type from array<array-key,
mixed> to a string-array (e.g. array<int, string> or string[] ) so static
analysis reflects that implode("\n", $backup->ignored_files) yields strings;
update the `@property` annotation in the Backup class to "@property
array<int,string>|string[] $ignored_files" (and if necessary ensure the Eloquent
cast for 'ignored_files' is 'array' so values are always strings).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@app/Models/File.php`:
- Around line 27-29: Update the PHPDoc for the File model so the file-type flags
are documented as booleans: change the PHPDoc types for is_directory, is_file,
and is_symlink from int to bool to match getSchema() and how the rest of the
codebase uses them; locate the docblock containing those `@property` annotations
in the File class and replace the int types with boolean (or bool) to keep
static analysis and IDE hints correct.

---

Nitpick comments:
In `@app/Models/Backup.php`:
- Line 22: The property docblock for Backup::$ignored_files is too broad; change
its type from array<array-key, mixed> to a string-array (e.g. array<int, string>
or string[] ) so static analysis reflects that implode("\n",
$backup->ignored_files) yields strings; update the `@property` annotation in the
Backup class to "@property array<int,string>|string[] $ignored_files" (and if
necessary ensure the Eloquent cast for 'ignored_files' is 'array' so values are
always strings).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 10e34099-a986-43a8-a777-be1ded89b826

📥 Commits

Reviewing files that changed from the base of the PR and between a218315 and 7c54665.

📒 Files selected for processing (9)
  • app/Models/Allocation.php
  • app/Models/Backup.php
  • app/Models/Database.php
  • app/Models/EggVariable.php
  • app/Models/File.php
  • app/Models/Schedule.php
  • app/Models/Server.php
  • app/Models/WebhookConfiguration.php
  • app/Services/Helpers/PluginService.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/Services/Helpers/PluginService.php

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.

1 participant