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
Fix removal of useless @param tag when string|null insteadof ?string is used. #5684
Fix removal of useless @param tag when string|null insteadof ?string is used. #5684
Conversation
I'm actually not sure about the change in
|
@@ -94,7 +94,7 @@ private function createUnionTypeHash(UnionType $unionType): string | |||
$normalizedUnionType = clone $unionType; | |||
|
|||
// change alias to non-alias | |||
$normalizedUnionType = TypeTraverser::map( | |||
TypeTraverser::map( |
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 TypeTraverser::map
from line 96 to 106 seems no longer needed, then we can see if that broke something, so we can revert early :)
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.
You can just remove exactly line 96 to 106, the clone seems still needed.
Please use git rebase instead so only your commits shown in this PR |
@@ -91,21 +91,7 @@ private function createUnionTypeHash(UnionType $unionType): string | |||
return $booleanType->describe(VerbosityLevel::precise()); | |||
} | |||
|
|||
$normalizedUnionType = clone $unionType; |
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.
the clone is somehow still needed, see error in test https://github.com/rectorphp/rector-src/actions/runs/8169922103/job/22334963648#step:5:93
$normalizedUnionType = clone $unionType; | |
$clonedUnionType = clone $unionType; | |
return $clonedUnionType->describe(VerbosityLevel::precise()); |
b276474
to
098532a
Compare
…is used. Fixed by removing the "skip union types" in ParamTagRemover. This was added to fix a different bug, cause a bug in TypeHasher, where the normalized UnionType was actually overwritten by the last element in the union,
098532a
to
d54f5ae
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.
Thank you @arjenschol , I will clean up in separate PR, or revert if it cause regression
@TomasVotruba I am merging it ;)
Fixed by removing the "skip union types" in ParamTagRemover. This was added to fix a different bug, caused by a bug in TypeHasher, where the normalized UnionType was actually overwritten by the last element in the union,