Skip to content

Fix PSR-4 autoloading for TransferStatusEnum#59

Merged
ChiragAgg5k merged 1 commit intomasterfrom
fix/transfer-status-enum-psr4
Feb 25, 2026
Merged

Fix PSR-4 autoloading for TransferStatusEnum#59
ChiragAgg5k merged 1 commit intomasterfrom
fix/transfer-status-enum-psr4

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Feb 24, 2026

Summary

  • TransferStatusEnum was defined inside TransferStatus.php, causing PSR-4 autoloading to fail when referencing it by name
  • Moved the enum into its own TransferStatusEnum.php file to satisfy the PSR-4 requirement that filename matches type name

Test plan

  • Verify TransferStatusEnum can be autoloaded without a manual require
  • Verify TransferStatus still resolves TransferStatusEnum correctly (same namespace, no use needed)

Summary by CodeRabbit

  • Refactor
    • Reorganized domain registrar transfer status code structure for improved maintainability.

Note: This release contains no user-facing changes.

Move TransferStatusEnum into its own TransferStatusEnum.php file so
PSR-4 autoloading can resolve it by class name.
@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

Walkthrough

The TransferStatusEnum enum was extracted from src/Domains/Registrar/TransferStatus.php into a new dedicated file src/Domains/Registrar/TransferStatusEnum.php. The enum maintains its string type and eight cases: Transferrable, NotTransferrable, PendingOwner, PendingAdmin, PendingRegistry, Completed, Cancelled, and ServiceUnavailable. The original enum definition is now located in the separate file with identical functionality.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: moving TransferStatusEnum to its own file to fix PSR-4 autoloading compliance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/transfer-status-enum-psr4

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.

🧹 Nitpick comments (1)
src/Domains/Registrar/TransferStatusEnum.php (1)

1-1: Consider adding declare(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

📥 Commits

Reviewing files that changed from the base of the PR and between 20b6a68 and 14ee4aa.

📒 Files selected for processing (2)
  • src/Domains/Registrar/TransferStatus.php
  • src/Domains/Registrar/TransferStatusEnum.php
💤 Files with no reviewable changes (1)
  • src/Domains/Registrar/TransferStatus.php

@ChiragAgg5k ChiragAgg5k merged commit b4896a6 into master Feb 25, 2026
7 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix/transfer-status-enum-psr4 branch February 25, 2026 08:18
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