PhpStorm:PHPDoc 格式化设置

PhpStorm: PHPDoc formatting setup

我想知道是否有办法根据 Laravel's guide

制作 PhpStorm 格式的停靠块

我知道如何使用设置将其设置为 PSR-1/2 兼容,以及如何使用附加选项进行一些可用的格式化,如屏幕截图所示:

我不知道如何强制它:

the @param attribute is followed by two spaces, the argument type, two more spaces, and finally the variable name

有效地给我:

/**
 * Register a binding with the container.
 *
 * @param  string|array  $abstract
 * @param  \Closure|string|null  $concrete
 * @param  bool  $shared
 * @return void
 */

我只能让它执行以下操作(请注意 @param 和参数类型后的单个空格):

/**
 * Register a binding with the container.
 *
 * @param string|array $abstract
 * @param \Closure|string|null $concrete
 * @param bool $shared
 * @return void
 */

是否有任何方法可以使其根据此规范重新格式化代码?

目前根本没有这样的选项。

https://youtrack.jetbrains.com/issue/WI-18408 和相关票证——观看它们 (star/vote/comment) 以获得有关任何进展的通知。


同时 -- 也许您可以使用一些可以进行此类格式化的第 3 方工具?它可以作为外部工具手动调用(菜单或快捷方式),甚至可以作为文件观察器(在文件修改时运行)调用。