PHPDocbloc:将继承的方法更改为标准链接@inheritDoc-最佳实践?
我有大量的PHP代码行。许多方法包含的docblock实际上是从它们重写的方法继承的 例如:PHPDocbloc:将继承的方法更改为标准链接@inheritDoc-最佳实践?,php,docblocks,Php,Docblocks,我有大量的PHP代码行。许多方法包含的docblock实际上是从它们重写的方法继承的 例如: MyBaseClass { /** * @param string $first - first name * @param string $last - last name */ protected function MyMethod($first, $last) { } /** * @return b
MyBaseClass {
/**
* @param string $first - first name
* @param string $last - last name
*/
protected function MyMethod($first, $last)
{
}
/**
* @return bool
*/
public function MyMethod2($first, $last)
{
}
}
MyChildClass extends MyBaseClass {
/**
* @param string $first - first name
* @param string $last - last name
*/
protected function MyMethod($first, $last)
{
}
/**
* @return bool
*/
public function MyMethod2($first, $last)
{
}
}
基本上,我希望子类中的docblocks如下所示:
/**
* @inheritDoc
*/
因为据我所知,这是最佳实践。如果这是最佳实践,有人能推荐我可以使用什么程序/技巧/代码将所有这些继承的文档更改为上面的基本文档吗 PhpStorm应该能够做到这一点——因此,如果您使用扩展方法,应该有一个复选框来启用插入
inheritDoc
。还有额外的插件来调整这种行为,例如…这是一个很好的答案。有没有更简单的工具(我使用ATOM,我不太想改变)?谢谢抱歉,我对Atom插件不太熟悉。