-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
[TypeDeclaration] optionally only add types for hard coded return values in ReturnTypeFromStrictScalarReturnExprRector
#5364
[TypeDeclaration] optionally only add types for hard coded return values in ReturnTypeFromStrictScalarReturnExprRector
#5364
Conversation
rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictScalarReturnTypeAnalyzer.php
Show resolved
Hide resolved
rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictScalarReturnTypeAnalyzer.php
Show resolved
Hide resolved
rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictScalarReturnExprRector.php
Show resolved
Hide resolved
rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictScalarReturnExprRector.php
Show resolved
Hide resolved
Build failure seems to be unrelated (/incidental hickup by composer while downloading a package?) |
Ran it on my actual work project. And well, it works 😃 Did it in two stages, as desired. So first with the |
@RobertMe Thanks for fast work. I drifted my attention away over holidays and only got to see this one. Could you rebase the PR? cc @samsonasik Could you review this one? |
b196f84
to
fb2d6ae
Compare
@TomasVotruba , sure, rebased. I don't mind it took a bit longer, it's the holiday season anyway and everybody needs some rest 😄 |
rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictScalarReturnExprRector.php
Show resolved
Hide resolved
rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictScalarReturnExprRector.php
Outdated
Show resolved
Hide resolved
rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictScalarReturnExprRector.php
Outdated
Show resolved
Hide resolved
rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictScalarReturnTypeAnalyzer.php
Outdated
Show resolved
Hide resolved
fb2d6ae
to
594536b
Compare
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.
Looking good 👍
Thank you @RobertMe |
…ues in `ReturnTypeFromStrictScalarReturnExprRector`
} | ||
CODE_SAMPLE | ||
, | ||
[ | ||
ReturnTypeFromStrictScalarReturnExprRector::HARD_CODED_ONLY => true, |
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 need false per default value for consistency
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.
Yip, and the example output was wrong as well 🙈 Noticed that myself too when once more going over your comments
594536b
to
b7262ea
Compare
Thank you @samsonasik for the review and merging 😃. You were even quicker with merging then I was going through the comments (and then finding the "issue" with the config example and having to fix it once more). |
Thank you @RobertMe 👏 |
Supersedes #5361, relates to rectorphp/rector#8362