IntelliJ IDEA 13.1.0 Web Help

Some features described here are available in Ultimate edition only.

IntelliJ IDEA creates stubs of PHPDoc blocks on typing the opening tag /** and pressing .

If this feature is applied to a method or a function, @param, @access, @static, @throws, and @abstract tags are created. In any other places IntelliJ IDEA adds an empty documentation stub.

If you need additional PHP-specific tags, IntelliJ IDEA provides code completion that suggests tag names that are relevant in the current context. If a certain tag has multiple values, the same code completion provides a list of available values.

In PHPDoc comments, IntelliJ IDEA supports the following formatting options in compliance with ZEND, PEAR, and other standards:

  • Align parameter names
  • Align tag comments
  • Align key-value pairs
  • Align consecutive assignments


PHPDoc comments in your source code are available for the Quick Documentation Lookup feature and open for review on pressing or or or or or or or , or , or or or .

On this page:

To enable or disable automatic creation of documentation comments
  1. Open the Settings dialog box and navigate to the Editor. Smart Keys page.
  2. In the Enter section, select or clear Insert documentation comment stub check box.
Creating a PHPDoc block for a method or a function
  1. Place the caret before the method or function declaration.
  2. Type the opening block comment /** and press .
  3. Describe the listed parameters and return values.


    IntelliJ IDEA checks syntax in the comments and treats it according to the PHP Inspections settings.

Creating tags in a PHPDoc comment block
  1. In a PHPDoc block, select the desired empty line and press or .
  2. Select the relevant tag from the suggestion list.
  3. If the entered tag has several values, press or and select the desired value from the suggestion list.
Inspecting PHPDoc comments

IntelliJ IDEA provides a set of predefined code inspections targeted at PHPDoc blocks. These inspections check whether classes, methods, functions, variables, and constants are supplied with a PHPDoc comment and whether the tags in the comment match the documented item.

  • To enable or disable an inspection:
    1. Choose File | Settings on the main menu, and in the Settings dialog box that opens, click Inspections.
    2. On the Inspections page that opens, expand the PHPDoc node under the PHP node. The list of predefined inspections is displayed.
    3. To enable or disable an inspection, select or clear the check box next to it.
  • To have IntelliJ IDEA check that PHPDoc comments are provided for all code constructs of a certain type:
    1. Select the check box next to the Missing PHPDoc Comment inspection.
    2. In the Options area, select the check boxes next to the required code construct type: class, method, function, variable, or constant.
    3. To suppress reporting a Missing PHPDoc Comment error if a method or function does not contain any parameters and/or return values, select the Skip if empty.

See Also



External Links:

Web Resources: