-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add type for AssociationMapping #9794
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
Conversation
@greg0ire I tried to add all the key with some type to the AssociationMapping, by looking at the usage. I can't be sure if I have all the possible key, and if I didn't make any mistake about the optional ones This is useful when using
because it avoid to write
for phpstan. I fixed two baseline errors, but I have a new one:
is throwing
Can the type be a string ? I thought it would be the const |
I'm on my phone so it's hard to help, but I'm OK with the "good start, possibly incorrect" way of doing things when it's just about phpdoc. Regarding the new issue, maybe try throwing when it's a string and then run the test suite, to see if that case is covered? |
Seems like it was just a bug since The phpdoc added a lot of issues with psalm (most of them are possibly undefined offset); there are too much to solve so I updated the psalm baseline |
We should try to reduce the set of optional keys in that array. Otherwise we'll find ourselves adding lots of pointless |
Sure, but do you see any key which are not optional and I made optional ? I'll try to take a new look soon but I'm not sure that's possible since it depends on the type and the config of the relation. |
For instance, most of the boolean keys look like it would make sense to always define them. Not sure if that'll help us though. |
I thought you were talking about the phpdoc and the type I introduced. Indeed it would make sens to aways define them. But I wouldn't risk those change in this PR because
Do you think it must be done with this PR ? |
<file src="lib/Doctrine/ORM/ORMSetup.php"> | ||
<UndefinedClass occurrences="1"> | ||
<code>MemcachedAdapter::createConnection('memcached://127.0.0.1')</code> | ||
</UndefinedClass> | ||
</file> |
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.
This error looks odd and unrelated to your changes.
No. This PR is a great step towards getting our types under control. Let's iterate from there. |
Thanks @VincentLanglet ! |
No description provided.