Make a single-line comment in PhpStorm

Viewed 649

How can I make PhpStorm with a short PHPDoc comments show the comment in a single line instead of multiple lines?

How that is displayed now:

/**
 * @return int[]
 */
public static function defaultAccountValidationCollection(){}

I want this:

/** @return int[] */
public static function defaultAccountValidationCollection(){}
2 Answers

You can change Function Doc Comment Template for PhpStorm like this:

/** ${PARAM_DOC} #if (${TYPE_HINT} != "void") @return ${TYPE_HINT} #end ${THROWS_DOC} */

*

But single line doc approach is not useful. Because; functions can take multiple parameters, can return different objects, can have proper explanation of what it does. Why do you limit yourself?

You can use single line doc for variables and properties. Write above them: /** and press space.

Related