Skip to content

Remove MyCLabs\Enum support#794

Merged
oojacoboo merged 1 commit intothecodingmachine:masterfrom
oojacoboo:remove-myclabs-php-enum
Apr 19, 2026
Merged

Remove MyCLabs\Enum support#794
oojacoboo merged 1 commit intothecodingmachine:masterfrom
oojacoboo:remove-myclabs-php-enum

Conversation

@oojacoboo
Copy link
Copy Markdown
Collaborator

Closes #727.

Summary

Removes all support for the myclabs/php-enum library. PHP 8.1 native enums are the standard going forward. Security support for PHP 8.0 has long passed and ends for 8.1 at the end of this year, so there is no reason to continue carrying the legacy implementation.

What changed

  • Deleted MyCLabsEnumTypeMapper, MyCLabsEnumType, and the (already deprecated) #[EnumType] annotation.
  • Removed the conditional MyCLabsEnumTypeMapper registration from SchemaFactory::createSchema(), along with the matching wiring in AbstractQueryProvider and IntegrationTestCase.
  • Dropped AnnotationReader::getEnumTypeAnnotation() (its only caller was the MyCLabs mapper).
  • Dropped myclabs/php-enum from require-dev in composer.json.
  • Converted the TestEnum and ProductTypeEnum fixtures to native backed enums, and updated the two controllers / one test that referenced their MyCLabs-style ::CASE() accessors.
  • Pruned the MyCLabs paragraphs from website/docs/type-mapping.mdx, website/docs/internals.md, and website/docs/annotations-reference.md. Versioned docs (website/versioned_docs/**) are left untouched as historical snapshots.

Test plan

  • vendor/bin/phpunit — 492 tests / 1180 assertions, all pass
  • vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=1G[OK] No errors
  • vendor/bin/phpcs — clean

PHP 8.1 native enums are the standard going forward. Security support for
PHP 8.0 has long passed and ends for 8.1 at the end of this year, so there
is no reason to continue supporting the myclabs/php-enum library.

- Delete MyCLabsEnumTypeMapper, MyCLabsEnumType and the @EnumType annotation
- Drop the MyCLabsEnumTypeMapper wiring from SchemaFactory and test harnesses
- Remove the getEnumTypeAnnotation() helper from AnnotationReader
- Drop myclabs/php-enum from require-dev
- Convert TestEnum and ProductTypeEnum fixtures to native backed enums
- Prune MyCLabs docs from current website/docs/ (versioned docs kept intact)
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.73%. Comparing base (53f9d49) to head (669a186).
⚠️ Report is 144 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #794      +/-   ##
============================================
- Coverage     95.72%   94.73%   -0.99%     
- Complexity     1773     1832      +59     
============================================
  Files           154      172      +18     
  Lines          4586     4808     +222     
============================================
+ Hits           4390     4555     +165     
- Misses          196      253      +57     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@oojacoboo oojacoboo merged commit 50a5486 into thecodingmachine:master Apr 19, 2026
13 checks passed
@oojacoboo oojacoboo deleted the remove-myclabs-php-enum branch April 19, 2026 01:48
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.

Remove MyCLabs\Enum\Enum

2 participants