禁止导入PHPDoc的类 [英] Disable import of classes for PHPDoc

查看:103
本文介绍了禁止导入PHPDoc的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对PhpStorm的一件事是很容易地导入类(为您添加use语句).但是,这种烦恼是当您实际上不希望它导入类时.例如,当我将一个方法的返回值记录为另一个类时.

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.

是否只有在PHPDoc块中进行注释时,才能禁用PhpStorm的类导入?

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

推荐答案

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

If I understand your request correctly...

  1. Settings/Preferences
  2. Editor | Code Style | PHP
  3. PHPDoc标签
  4. Generated Doc Blocks
  5. 下有Use fully-qualified class names
  1. Settings/Preferences
  2. Editor | Code Style | PHP
  3. PHPDoc tab
  4. There is Use fully-qualified class names under Generated Doc Blocks

在完成@return中的尚未导入的课程时,该选项即可完成工作(对@param和其他人应该执行相同的操作-自己未测试其他标签-仅选中了在@return上).

That option does the job when completing not-yet-imported class in @return (should do the same for @param and others -- have not tested other tags myself -- only checked on @return).

相关说明:该票据要求具有始终在PHPDoc块中使用FQN的功能(实现为Inspection ..可以打开或关闭).可能对您有用-考虑投票.

On related note: this ticket is asking to have an ability to always use FQN in PHPDoc blocks (implemented as Inspection .. so can be turned on or off). Might be useful for you -- consider voting.

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

这篇关于禁止导入PHPDoc的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆