-
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
Fix discriminatorColumn phpdoc #9168
Conversation
Psalm is failing because |
Hi Vincent!
Maybe not always, but as soon as there is inheritance, it probably is: orm/lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php Lines 200 to 213 in 6f194ee
|
I added some assert checks to fix the psalm build. |
Looks like the failure is due to doctrine/dbal@317c05620 . We are asserting against the generated SQL 😬 |
Blocked by #9181 |
Thanks, tests are fine now @greg0ire if you find some time to review :) |
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.
All these assert
calls look a bit clumsy, repetitive, and are a code smell…
How about introducing a final public function discriminatorColumn()
in ClassMetadataInfo
that performs the assertion, or better, throws a LogicException
saying that this class probably does not have inheritance mapping?
Hi @greg0ire, since the property is not initialized, the phpdoc should allow
null
.This avoid a phpstan error if we're doing an
isset
check on the property.The other solution is to initialize the value to
[]
but tests are failing