Report @inheritDoc when there is no PHPDoc to inherit from#5583
Report @inheritDoc when there is no PHPDoc to inherit from#5583kubawerlos wants to merge 4 commits intophpstan:2.1.xfrom
@inheritDoc when there is no PHPDoc to inherit from#5583Conversation
|
I think we should distinguish two different case
|
ondrejmirtes
left a comment
There was a problem hiding this comment.
The correct way to find parent methods is ParentMethodHelper.
|
@VincentLanglet do you mean as separate rules? |
|
Not a class, but an error identifier for sure. |
bc204fc to
fd71add
Compare
|
Hi @kubawerlos could you rebase and solve the conflict ? |
| continue; | ||
| } | ||
|
|
||
| if (preg_match(self::INLINE_INHERIT_DOC_REGEX, $child->text, $matches) !== 1) { |
There was a problem hiding this comment.
Can't we do better ?
I know it'll be an edge case but you won't catch description like
/**
* Please do not add `{@inheritDoc}` to this method
*/
There was a problem hiding this comment.
I'm not very good in regex but looking at the test called InheritDocInsideBackticks i'm not sure we understood each other.
My point was that, we might not want to consider that a method with
/**
* Foo @inheritDoc
*/
has an inheritDoc, cause it might be just a comment.
It wasn't related to backticks
(On the opposite,
/**
* @inheritDoc Bar
*/
might be considered as an inherit doc with an extra comment... ; I dunno)
I never use inheritDoc so I can't stay what we can find in codebase.
There was a problem hiding this comment.
Updated test.
@inheritDoc Bar will be tokenised as a tag with extra description.
fd71add to
00f4776
Compare
Closes phpstan/phpstan#5561