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

Skip null type in ReturnTypeFromStrictScalarReturnExprRector as often not desired #5462

Merged
merged 1 commit into from
Jan 13, 2024

Conversation

TomasVotruba
Copy link
Member

No description provided.

@TomasVotruba TomasVotruba enabled auto-merge (squash) January 13, 2024 09:40
@TomasVotruba TomasVotruba merged commit 9d310ce into main Jan 13, 2024
40 checks passed
@TomasVotruba TomasVotruba deleted the tv-return-null branch January 13, 2024 09:41
@@ -117,6 +118,11 @@ public function refactorWithScope(Node $node, Scope $scope): ?Node
return null;
}

// skip null as often placeholder value and not an only type
if ($scalarReturnType instanceof NullType) {
Copy link
Member

Choose a reason for hiding this comment

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

this should be fine on Function_, Closure, and when class is final, so that seems need to be checked

I will add new PR for that.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see what you mean about placeholder, seems ok then

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

Successfully merging this pull request may close these issues.

2 participants