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

[Feature] Add ReturnAnnotationIncorrectNullableRector for fixing incorrect null type in @return #2060

Conversation

dorrogeray
Copy link
Contributor

Extracted PR from #2049

Added new ReturnAnnotationIncorrectNullableRector which adds or removes null type from @return phpdoc typehint based on php return type declaration


namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnAnnotationIncorrectNullableRector\Fixture;

final class ParamAnnotationIncorrectlyIncludesNullOnScalar
Copy link
Member

Choose a reason for hiding this comment

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

Param should be Return

*/
public function getNodeTypes(): array
{
return [ClassMethod::class];
Copy link
Member

Choose a reason for hiding this comment

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

Node\Stmt\Function_ should can be added as well

@TomasVotruba TomasVotruba merged commit a1ac1b6 into rectorphp:main Apr 12, 2022
@TomasVotruba
Copy link
Member

Thank you 👍

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