0

One thing I love about PhpStorm is the easy import of classes (adding the use statement for you). However, the annoyance with this is when you don't actually want it to import the class. For example, when I'm documenting a method's return value as another class.

Is there any way to disable PhpStorm's import of classes only when annotating in PHPDoc blocks?

4

1 回答 1

3

如果我正确理解您的要求...

  1. Settings/Preferences
  2. Editor | Code Style | PHP
  3. PHPDoc标签
  4. Use fully-qualified class namesGenerated Doc Blocks

该选项在完成尚未导入的类时完成工作@return(应该为@param和其他人做同样的事情——我自己没有测试过其他标签——只检查了@return)。

在此处输入图像描述


相关说明:此票要求能够始终在 PHPDoc 块中使用 FQN(实现为 Inspection .. 因此可以打开或关闭)。可能对您有用——考虑投票。

https://youtrack.jetbrains.com/issue/WI-28591

于 2017-08-04T08:33:40.710 回答