Fix PSR-4 autoloading for TransferStatusEnum#59
Conversation
Move TransferStatusEnum into its own TransferStatusEnum.php file so PSR-4 autoloading can resolve it by class name.
WalkthroughThe Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/Domains/Registrar/TransferStatusEnum.php (1)
1-1: Consider addingdeclare(strict_types=1)for consistency.Most PHP files in this project likely declare strict types. The absence here is inconsistent and could cause unexpected type coercion if the enum is ever used in a typed-function context.
#!/bin/bash # Check whether other PHP files in the project use declare(strict_types=1) rg -l "declare\(strict_types=1\)" --type php | head -10♻️ Proposed addition
<?php + +declare(strict_types=1); namespace Utopia\Domains\Registrar;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Domains/Registrar/TransferStatusEnum.php` at line 1, Add a strict types declaration at the top of this PHP enum file: insert declare(strict_types=1); after the opening <?php to match project-wide typing conventions so TransferStatusEnum is evaluated under strict mode; update the file containing the TransferStatusEnum definition accordingly to maintain consistency with other PHP files.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/Domains/Registrar/TransferStatusEnum.php`:
- Line 1: Add a strict types declaration at the top of this PHP enum file:
insert declare(strict_types=1); after the opening <?php to match project-wide
typing conventions so TransferStatusEnum is evaluated under strict mode; update
the file containing the TransferStatusEnum definition accordingly to maintain
consistency with other PHP files.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/Domains/Registrar/TransferStatus.phpsrc/Domains/Registrar/TransferStatusEnum.php
💤 Files with no reviewable changes (1)
- src/Domains/Registrar/TransferStatus.php
Summary
TransferStatusEnumwas defined insideTransferStatus.php, causing PSR-4 autoloading to fail when referencing it by nameTransferStatusEnum.phpfile to satisfy the PSR-4 requirement that filename matches type nameTest plan
TransferStatusEnumcan be autoloaded without a manualrequireTransferStatusstill resolvesTransferStatusEnumcorrectly (same namespace, nouseneeded)Summary by CodeRabbit
Note: This release contains no user-facing changes.