-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
Incorrect behavior of ReturnTypeFromReturnNewRector #6595
Comments
Could you create PR for faling fixture to https://github.com/rectorphp/rector-src/tree/main/rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromReturnNewRector/Fixture ? Thank you. |
I'd be happy to. Is there some documentation for this? This is my first interaction with this repository, and I'm not familiar with the failing fixtures concept. I'm sure it's quite simple, but I'm uninitiated. |
You can click "Create a test" button at https://getrector.org/demo/1ebef269-093c-6afe-9c29-afdc8959befb |
Ah, wonderful. I'll do just that. |
# Failing Test for ReturnTypeFromReturnNewRector Based on https://getrector.org/demo/1ebef269-093c-6afe-9c29-afdc8959befb refs rectorphp/rector#6595
…rnNewRector (#603) * Add failing test fixture for ReturnTypeFromReturnNewRector # Failing Test for ReturnTypeFromReturnNewRector Based on https://getrector.org/demo/1ebef269-093c-6afe-9c29-afdc8959befb refs rectorphp/rector#6595 * Closes #602 Fixes rectorphp/rector#6595 * final touch * centralize check in TypeFactory * mixed * clean up Co-authored-by: Dominik Peters <kuhlesdominik@gmx.de>
* Add failing test fixture for ReturnTypeFromReturnNewRector # Failing Test for ReturnTypeFromReturnNewRector Based on https://getrector.org/demo/1ebef269-093c-6afe-9c29-afdc8959befb refs rectorphp/rector#6595 * Add failing test fixture for RemoveUnusedPrivateMethodRector # Failing Test for RemoveUnusedPrivateMethodRector Based on https://getrector.org/demo/1ebf50d7-992f-63ba-9a8a-bd39c81b9232 refs: rectorphp/rector#6613 * fix test case skip_abstract_private_method_in_trait.php.inc * remove file from previous PR * fix fixture by moving namespace to top * import TraitUse * use AstResolver * added test case to check if non-abstract private methods are considered * refac: moved "is used" checks into it's own class to reduce class complexity * rename constructor arg to represent class name
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.org/demo/1ebef269-093c-6afe-9c29-afdc8959befb
Responsible rules
ReturnTypeFromReturnNewRector
Expected Behavior
The return type should either be:
...without the leading slash (global namespace), or the name of the class. I'm uncertain what the implications of choosing for the user would be as inheritance may come into play.
The text was updated successfully, but these errors were encountered: