Skip to content
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

Update getAssociationTargetClass phpdoc #8907

Merged
merged 2 commits into from
Aug 11, 2021
Merged

Update getAssociationTargetClass phpdoc #8907

merged 2 commits into from
Aug 11, 2021

Conversation

VincentLanglet
Copy link
Contributor

Now the interface can return null, doctrine/persistence#192, the phpdoc here should be precised because it never return null.

@@ -3409,6 +3409,9 @@ public function getAssociationNames()
/**
* {@inheritDoc}
*
* @return string
* @psalm-return class-string
*
* @throws InvalidArgumentException
*/
public function getAssociationTargetClass($assocName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why Psalm suddenly requires $assocName to be documented 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

psalm has a "All or nothing" strategy. So indeed, since I add the return tag, I have to add the param too... edited.

@greg0ire greg0ire added the Bug label Aug 11, 2021
@greg0ire greg0ire merged commit b19a13f into doctrine:2.9.x Aug 11, 2021
@greg0ire
Copy link
Member

Thanks @VincentLanglet ! I squashed and used a commit message explaining why you are doing this: b19a13f

@VincentLanglet VincentLanglet deleted the patch-4 branch August 11, 2021 20:54
@VincentLanglet
Copy link
Contributor Author

Thanks ! Don't know if this is worth enough for a release, in order to avoid consumer with phpstan/psalm to not having too deal with null values (since the persistence repository was released recently)

@greg0ire
Copy link
Member

The last release is quite old, so while by itself it's probably not worth it, I think we might want to release anyway.

@greg0ire greg0ire added this to the 2.9.4 milestone Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants