ResolvedPhpDocBlock: fix parent return tag merging - #2803
Merged
Conversation
ondrejmirtes
approved these changes
Dec 5, 2023
| $parentType, | ||
| static function (Type $type, callable $traverse) use ($classReflection): Type { | ||
| if ($type instanceof StaticType) { | ||
| return $type->changeBaseClass($classReflection); |
Member
There was a problem hiding this comment.
Great, I'd fix this the same way so 👍
I just hate adding new properties to this class but I didn't figure out a better solution. yet. Merging this.
Contributor
|
it seems the change fixes more stuff, see https://github.com/phpstan/phpstan-src/actions/runs/7100699219?pr=2803 |
Contributor
|
Regression tests for all fixed issues would be good. Sorry I did not mention it earlier |
Contributor
Author
|
@staabm All those look the same. But we can add them to be sure.. |
Contributor
Author
|
@staabm Added |
ondrejmirtes
requested changes
Dec 5, 2023
ondrejmirtes
requested changes
Dec 6, 2023
Member
|
Thank you! |
This was referenced Dec 8, 2023
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should resolve:
@return $thison interface causes covariant error phpstan#6462/** @return static */doesn't work properly with extended abstract class phpstan#4396Current failure: https://phpstan.org/r/f8871cfa-7e74-48a3-854f-cb64495aabea