Skip to content

feat(stub): Add enums for backed integer, backed string, and unit values in the Stub namespace.#24

Merged
terabytesoftw merged 3 commits intomainfrom
feature_2
Feb 3, 2026
Merged

feat(stub): Add enums for backed integer, backed string, and unit values in the Stub namespace.#24
terabytesoftw merged 3 commits intomainfrom
feature_2

Conversation

@terabytesoftw
Copy link
Contributor

Pull Request

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

@terabytesoftw terabytesoftw added the enhancement New feature or request label Feb 3, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

Warning

Rate limit exceeded

@terabytesoftw has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 3a1f58d and d641f3b.

📒 Files selected for processing (6)
  • src/ReflectionHelper.php
  • tests/EnumDataProviderTest.php
  • tests/Stub/TestBackedEnum.php
  • tests/Stub/TestEnum.php
  • tests/Stub/TestIntBackedEnum.php
  • tests/Support/Provider/EnumDataProviderProvider.php
📝 Walkthrough

Walkthrough

This pull request introduces three new stub enum classes to the PHPForge\Support\Stub namespace: BackedInteger, BackedString, and Unit. These enums are designed to provide deterministic values for the test suite. A changelog entry documents this enhancement.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added changelog entry for Enh #24 documenting the introduction of backed integer, backed string, and unit enums in the Stub namespace.
Stub Enums
src/Stub/BackedInteger.php, src/Stub/BackedString.php, src/Stub/Unit.php
Added three new enum stubs: BackedInteger (int-backed with VALUE = 1), BackedString (string-backed with VALUE = 'value'), and Unit (pure enum with case value). These provide deterministic values for tests.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Three enums hop into the Stub,
Backed by ints and strings, oh what a club!
With VALUE and value, deterministic and true,
Test suite delight—our tests love you! 🎪

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding three new enums (backed integer, backed string, and unit values) to the Stub namespace.
Description check ✅ Passed The description is related to the changeset, confirming this is a new feature that does not break backward compatibility, which aligns with the added stub enums.
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 unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature_2

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

🤖 Fix all issues with AI agents
In `@src/Stub/Unit.php`:
- Line 20: Rename the enum case in the Unit enum from lowercase "value" to
uppercase "VALUE" to match the sibling enums BackedInteger and BackedString and
keep naming consistent in the Stub namespace; update any references to
Unit::value elsewhere in the codebase to Unit::VALUE so usages, tests, and
switch statements (if any) continue to compile.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be49ce8 and 3a1f58d.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/Stub/BackedInteger.php
  • src/Stub/BackedString.php
  • src/Stub/Unit.php
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: terabytesoftw
Repo: php-forge/foxy PR: 115
File: tests/Fallback/AssetFallbackTest.php:158-189
Timestamp: 2026-01-23T11:22:07.261Z
Learning: User terabytesoftw prefers not to use aliases when importing classes in PHP. They are comfortable with either fully-qualified class names or direct imports without aliases.
Learnt from: terabytesoftw
Repo: php-forge/support PR: 12
File: src/TestSupport.php:0-0
Timestamp: 2025-08-18T20:13:33.518Z
Learning: User terabytesoftw prefers clean trait-based designs over maintaining backward compatibility wrappers when refactoring utility classes in the php-forge/support project.
Learnt from: terabytesoftw
Repo: php-forge/actions PR: 65
File: .github/workflows/composer-require-checker.yml:80-83
Timestamp: 2025-09-28T15:12:48.345Z
Learning: The user terabytesoftw prefers using floating tags like v1 for third-party actions in GitHub workflows instead of pinning to specific commit SHAs, even when it's a security best practice to pin to immutable commits.
🧬 Code graph analysis (2)
src/Stub/BackedInteger.php (3)
tests/Stub/TestIntBackedEnum.php (1)
  • TestIntBackedEnum (15-19)
tests/Stub/TestBackedEnum.php (1)
  • TestBackedEnum (15-19)
src/EnumDataProvider.php (1)
  • EnumDataProvider (25-104)
src/Stub/Unit.php (2)
src/EnumDataProvider.php (3)
  • EnumDataProvider (25-104)
  • normalizeValue (93-103)
  • tagCases (74-84)
tests/EnumDataProviderTest.php (2)
  • DataProviderExternal (36-75)
  • Group (30-100)
⏰ 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: phpunit / PHP 8.1-ubuntu-latest
  • GitHub Check: linter / Super Linter
  • GitHub Check: mutation / PHP 8.5-ubuntu-latest
  • GitHub Check: linter / Super Linter
🔇 Additional comments (3)
CHANGELOG.md (1)

7-7: LGTM!

The changelog entry follows the established format and correctly documents the new feature.

src/Stub/BackedInteger.php (1)

1-21: LGTM!

The enum is well-structured with proper strict types declaration, namespace, and documentation. The implementation correctly provides a deterministic backed integer value for test purposes.

src/Stub/BackedString.php (1)

1-21: LGTM!

The enum is well-structured with proper strict types declaration, namespace, and documentation. The naming convention (VALUE) is consistent with BackedInteger.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (48d173a) to head (d641f3b).
⚠️ Report is 15 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #24   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        15        29   +14     
===========================================
  Files              1         5    +4     
  Lines             38        81   +43     
===========================================
+ Hits              38        81   +43     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@terabytesoftw terabytesoftw merged commit edf6235 into main Feb 3, 2026
49 checks passed
@terabytesoftw terabytesoftw deleted the feature_2 branch February 3, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant