在@param注释中包含类的命名空间是一个好习惯吗?我知道phpdoc不支持命名空间,但其他工具如phpdox或Doxygen会如何处理?
哪种方式更好/更常见?
namespace foo\someNamespace;
use foo\someOtherNamespace\MyOtherClass;
--- with namespace ---
/**
* @param \foo\someOtherNamespace\MyOtherClass $otherClass
*/
class myClass(MyOtherClass $otherClass)
{
// do something
}
--- without namespace ---
/**
* @param MyOtherClass $otherClass
*/
class myClass(MyOtherClass $otherClass)
{
// do something
}
use
语句,因为我认为这会让代码更难理解。 - user895378