Inline comments for PhpDoc


I use to create the javadoc comments PhpStorm.
In the first step I write a function.

function myTestFunction(array $items, $string){

  // inline comment 1
  ... bla ...

  // inline comment 2
  ... blub ...

  return $items;

In this function are inline comments.

When I have finished this function i create the javadoc block.

Is there a way to automatically create a javadoc block ?

Is there a way to create a javadoc block with the inline comments ?

For example:

* inline comment 1
* inline comment 2
* @param $items array
* @param $string
* @return $items array

Sorry for my bad English.

Yours sincerely,


1 comment
Comment actions Permalink

Hi Stephan,

1) No, you cannot create PHPDoc comment from those inline comments.

2) Few ways how you can create PHPDoc comment block:

  • Place cursor on empty line above function declaration and type /**<ENTER>
  • If you have appropriate inspection enabled (Settings | Inspections | PHP | PHPDoc | Missing PHPDoc comment) then you can use Quick Fix to generate it (Alt+Enter on highlighted function name and choose appropriate entry)
  • "Code | Generate --> PHPDoc Blocks", then select methods/functions that will have missing PHPDoc's generated (you can select more than one)

Please sign in to leave a comment.