-
Notifications
You must be signed in to change notification settings - Fork 529
Implement FunctionReflection->getDocComment() #1834
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
Conversation
the errors of the failled job also appear in other currently open PRs, therefore seem unrelated |
@@ -149,7 +151,7 @@ public static function createEmpty(): self | |||
{ | |||
// new property also needs to be added to merge() | |||
$self = new self(); | |||
$self->phpDocString = '/** */'; |
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.
because I don't want to change this magic-value for BC reasons, I added a new hasPhpDocString
to determine whether a phpdoc is user-defined or not
@@ -202,6 +204,7 @@ public function merge(array $parents, array $parentPhpDocBlocks): self | |||
} | |||
} | |||
$result->phpDocNodes = $phpDocNodes; | |||
$result->phpDocString = $this->phpDocString; |
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.
without this line I got errors like
Error: Typed property PHPStan\PhpDoc\ResolvedPhpDocBlock::$phpDocString must not be accessed before initialization
now I see line 197 mentioning // skip $result->phpDocString - just for stubs
..hmm?
e7ef687
to
264a558
Compare
ebf1680
to
dc3cb51
Compare
just applied and covered the cases mentioned in #1804 (comment) |
49c6f13
to
1caf714
Compare
I just spent the morning working on this PR because I particularly didn't like the I wanted for Turns out we have to call |
Thank you. |
Now you can get to the |
Thanks for finishing it. I didn't like the hasPhpDoc-method either, but couldn't come up with something better which worked ;-) |
Yep, now I have a better idea on the cases beeing involved |
BTW looks like this PR broke several cases:
Can you please reproduce that and investigate that? Thaks! |
opened a separate issue to handle the regressions with phpstan/phpstan#8175 |
as discussed in #1804 (comment)