-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Reflection available to ConvertMappingCommand #9619
Make Reflection available to ConvertMappingCommand #9619
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The disconnected mf is required for xml/yml schemas. You can't just change it
Okay, could this be a fix?
|
Can you please open an issue that describes and reproduces your problem first? I'm having a hard time understanding this change. |
I have opened an issue with how to reproduce the bug #9659 |
The AnnotationDriver has the same kind of code to allow mapping conversion. Its an unfortunate side effect of our abstraction being sub optimal |
@bartholdbos yes this is the fix, can you duplicate it into AttributeDrivwr? |
Yes I have duplicated the fix into AttributeDriver |
d946ed4
to
21dfe6a
Compare
This fixes an exception when exporting mapping information using the ConvertMappingCommand from Attributes. The AttributeDriver needs a ReflectionClass in the loadMetadataForClass method. The ConvertMappingCommand sets up the ClassMetadataFactory as an instance of DisconnectedClassMetadataFactory which does not return ReflectionClasses
This reverts commit 35cc30b.
21dfe6a
to
b2bebd2
Compare
I added the PHPStan warning to the baseline as was done for the AnnotationDriver |
The pipeline is green, I think it's ready to be reviewed (and merged hopefully) |
@beberlei Hi Benjamin, could you maybe review the fix please? |
Thank you @bartholdbos! |
* 2.13.x: Deprecate omitting the alias in QueryBuilder (doctrine#9765) Run tests on PHP 8.2 (doctrine#9840) PHPStan 1.7.13 (doctrine#9844) Flip conditional extension of legacy AnnotationDriver class (doctrine#9843) PHP CodeSniffer 3.7 (doctrine#9842) Make Reflection available to ConvertMappingCommand (doctrine#9619) Add missing property declaration Use proper API for introspection of tables
Fixes #9659
This fixes an exception when exporting mapping information using the
ConvertMappingCommand from Attributes. The AttributeDriver needs a
ReflectionClass in the loadMetadataForClass method. The
ConvertMappingCommand sets up the ClassMetadataFactory as an instance of
DisconnectedClassMetadataFactory which does not return ReflectionClasses