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

Issues with phpdoc_to_return_type #4511

Closed
6 of 7 tasks
nicolas-grekas opened this issue Aug 19, 2019 · 5 comments
Closed
6 of 7 tasks

Issues with phpdoc_to_return_type #4511

nicolas-grekas opened this issue Aug 19, 2019 · 5 comments

Comments

@nicolas-grekas
Copy link

nicolas-grekas commented Aug 19, 2019

I'm playing with this rule on the Symfony codebase, here are some issues I found while doing so:

For the last two, we've decided it should be the rule for the Symfony codebase, so could be a separate rule maybe (forcing : object when a return $this/return static annotation is found and a return type is found too)

Note that I find a lot of false-positive editions related to return-type covariance: eg a child method declares @return Foo[], which leads to : array, while the parent says : iterable. But I guess we're hitting the limit of the tool and that's fine, there must be some.

SpacePossum added a commit that referenced this issue Oct 10, 2019
This PR was merged into the 2.15 branch.

Discussion
----------

Add suport for true/false return type hints.

fixes first issues listed here #4511

Commits
-------

20969b5 Add suport for true/false return type hints.
keradus added a commit that referenced this issue Nov 2, 2019
This PR was merged into the 2.15 branch.

Discussion
----------

PhpdocToReturnType - Add support for Foo[][]

fixes point two of #4511

backport of fixes done in #4583 by @jg-development , thanks!

Commits
-------

35e96ed PhpdocToReturnType - Add support for Foo[][].
keradus added a commit that referenced this issue May 3, 2021
…nfalque, keradus)

This PR was squashed before being merged into the 2.18 branch.

Discussion
----------

Refactor conversion of PHPDoc to type declarations

This PR:
* refactors parts of `PhpdocToParamTypeFixer` and `PhpdocToReturnTypeFixer` to ease sharing common logic.
* implements some points of #4511

Commits
-------

462260d Refactor conversion of PHPDoc to type declarations
@SpacePossum
Copy link
Contributor

checked off static as I think we handle is nicely now (including on PHP8 )

@Wirone Wirone added the status/to verify issue needs to be confirmed or analysed to continue label May 16, 2023
@Wirone
Copy link
Member

Wirone commented Jun 14, 2023

I looked at tests and I believe the only case missing is @return $this. I've marked todo item about static as resolved.

@Wirone Wirone removed the status/to verify issue needs to be confirmed or analysed to continue label Jun 14, 2023
@github-actions
Copy link

Since this issue has not had any activity within the last 90 days, I have marked it as stale.

The purpose of this action is to enforce backlog review once in a while. This is mostly for maintainers and helps with keeping repository in good condition, because stale issues and PRs can accumulate over time and make it harder for others to find relevant information. It is also possible that some changes has been made to the repo already, and issue or PR became outdated, but wasn't closed for some reason. This action helps with periodic review and closing of such stale items in automated way.

You may let maintainers handle this or verify current relevancy by yourself, to help with re-triage. Any activity will remove stale label so it won't be automatically closed at this point.

I will close it if no further activity occurs within the next 30 days.

@Wirone
Copy link
Member

Wirone commented Sep 13, 2023

@nicolas-grekas what's the current status from the Symfony side? I believe you don't need the support for PHP 7.1 (: object return type). Maybe we can just close this? 🙂

@nicolas-grekas
Copy link
Author

Correct, thanks for the reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants