PHPDoc Comments - kiril-dragomirov/PHPStorm GitHub Wiki

Enable documentation comments

  1. Open the Editor | General | Smart Keys page of PhpStorm settings (Ctrl+Alt+S).

  2. In the Enter section, select or clear Insert documentation comment stub checkbox.

Generate a PHPDoc block for a code construct to invoke generation of a PHPDoc block, do one of the following:

  1. Place the caret before the required code construct (class, method, function, and so on), type the opening block comment /**, and press Enter.

In the editor context menu, select Generate | Generate PHPDoc blocks and choose the code construct to generate PHPDoc comments for.

Press Alt+Insert, then select Generate PHPDoc blocks, and choose the code construct to generate PHPDoc comments for.

PhpStorm analyzes the appointed code construct, extracts the data for parameters, return values, variables, or fields where possible, and on this basis generates a stub of a documentation block.

  1. Describe the listed parameters and return values where necessary. PhpStorm checks and treats syntax in comments according to the PHP Inspections settings.