Skip to content

[Messenger] Fix PHPDoc #53914

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

Closed
wants to merge 4 commits into from
Closed

[Messenger] Fix PHPDoc #53914

wants to merge 4 commits into from

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Feb 12, 2024

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #...
License MIT

https://psalm.dev/docs/annotating_code/type_syntax/conditional_types/
https://psalm.dev/r/76330fe331

* @return StampInterface[]|StampInterface[][] The stamps for the specified FQCN, or all stamps by their class name
*
* @psalm-return ($stampFqcn is string : array<class-string<StampInterface>, list<StampInterface>> ? list<TStamp>)
* @return ($stampFqcn is string ? list<TStamp> : array<class-string<StampInterface>, list<StampInterface>>) The stamps for the specified FQCN, or all stamps by their class name
Copy link
Member

Choose a reason for hiding this comment

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

why merge return and psalm-return? I think we didn't anywhere yet so we shouldn't start in a PR like that

Copy link
Contributor Author

@ro0NL ro0NL Feb 14, 2024

Choose a reason for hiding this comment

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

i thought it made psalm trip, but no, it still errors. We should template stamps property still, but that's not a public API concern. Also i was unsure how to do it 😅

in fact we use both conditional @return and @psalm-return. Merge across the board welcome i think.

https://github.com/search?q=repo%3Asymfony%2Fsymfony+%22%40return+%28%22&type=code
https://github.com/search?q=repo%3Asymfony%2Fsymfony+%22%40psalm-return+%28%22&type=code

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we use conditional types in @return

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i dont mind, you can cherry pick a2c660b

@ro0NL ro0NL closed this Feb 20, 2024
@ro0NL ro0NL deleted the patch-1 branch February 20, 2024 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants