Add automatic {@inheritdoc} insertion.
Opened this issue · 6 comments
This would be really convenient, as atm I keep generating the default then deleting it and manually writing {@inheritdoc}. This should happen when interface method implemented or method overridden with same parameters.
I've added a new fix/suggestion for the upcoming version that will allow to replace a docblock directly with an inheritdoc.
I'm not sure whether/how to override the existing default behavior of the PHP plugin so that's probably the quickest win atm.
It should be released together with the next phpstorm release.
What's the status of this issue?
As a side note improvement, when using Generate PHPDoc for function
or Update PHPDoc comment
it could also take care of {@inheritDoc}
and use it if it's possible.
@GarryOne there is a "replace docblock with inheritDoc" alt-Enter action if the inheritDoc is missing.
@thanosp I don't see this option on PHPStorm 2018.3.5 and PHP inheritDoc helper
v1.5.1
The only option related to this is Add inheritDoc
when there is no DocBlocks at all. Otherwise, there's no option regarding this.
@GarryOne indeed when there's no doc you'd see add inheritDoc
and replace docblock with inheritDoc
when it already has one without inheritDoc.
@thanosp could you, please, post here a screenshot showing the context when replace docblock with inheritDoc
is displayed? Thank you.
I found it, finally, but it shows up only if your cursor is on the function name. I expected to see it also when the cursor is on the DocBlock or on the function parameters.
Or, when I type /**
and then press Enter to generate the DocBlock.