Remove MyCLabs\Enum support#794
Merged
oojacoboo merged 1 commit intothecodingmachine:masterfrom Apr 19, 2026
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #727.
Summary
Removes all support for the
myclabs/php-enumlibrary. 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
MyCLabsEnumTypeMapper,MyCLabsEnumType, and the (already deprecated)#[EnumType]annotation.MyCLabsEnumTypeMapperregistration fromSchemaFactory::createSchema(), along with the matching wiring inAbstractQueryProviderandIntegrationTestCase.AnnotationReader::getEnumTypeAnnotation()(its only caller was the MyCLabs mapper).myclabs/php-enumfromrequire-devincomposer.json.TestEnumandProductTypeEnumfixtures to native backed enums, and updated the two controllers / one test that referenced their MyCLabs-style::CASE()accessors.website/docs/type-mapping.mdx,website/docs/internals.md, andwebsite/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 passvendor/bin/phpstan analyse -c phpstan.neon --memory-limit=1G—[OK] No errorsvendor/bin/phpcs— clean