php - PhpStorm 不会为类型提示的函数/方法参数生成 docblock
问题描述
目前在我的 PhpStorm 上,我启用了以下选项:
File | Settings | Editor | Inspections | Missing @return tag` -> Marked both options there (Ignore PHPDoc without @param + Ignore PHPDoc with return type hint).
File | Settings | Editor | Inspections | PHPDoc comment matches function/method signature` -> Mark option about allowing params with typehint.
所以根据这些设置,我的功能应该是这样的:
/**
* @throws \Exception
*/
public function submit(string $email, string $message): Response
{
throw new \Exception('whatever');
}
当我有一个没有 docblock 的函数并且我按下 PhpStorm 为该函数自动生成 docblock 时,它也为已经输入提示的参数生成 docblocks:
所以像这样的函数:
public function submit(string $email, string $message): Response
{
throw new \Exception('whatever');
}
将转换为:
/**
* @param string $email
* @param string $message
* @throws \Exception
*/
public function submit(string $email, string $message): Response
{
throw new \Exception('whatever');
}
有没有一种方法可以配置我的 PhpStorm只为没有类型提示的参数生成文档块。
请注意,我知道我可以从 PhpStorm 配置模板。我尝试了那个解决方案。
在模板上,您只能告诉 PhpStorm 它是全有或全无。我找不到一种方法来告诉模板只有那些没有类型提示的参数文档块。
解决方案
推荐阅读
- jenkins - 詹金斯“加载”工作正常,然后在下一行是未定义的。这怎么可能?
- python - 如何抓取 text/html 中返回的 ajax 的特定内容?
- javascript - 如何在移动时通过网络摄像头检测/定位地板/地面
- python - Python中的嵌套类枚举类
- python-3.x - 检查多个字符串是否在另一个字符串中
- javascript - 如何播放 .wav 文件
- android - 使用像 gridview 这样的 Recyclerview
- java - 是否可以将元素添加到 SparseArray 的前面?
- python - 在不同的 Docker 容器中跨 Python 脚本的 IPC 共享内存
- javascript - Uncaught TypeError: $.get is not a function at
:1:3