Can Eclipse PDT automatically add PHPDoc Blocks to code where needed?

Kenzal Hunter picture Kenzal Hunter · Jan 26, 2009 · Viewed 18.7k times · Source

I know most of the java development tools for Eclipse will have a short-cut script for adding in JavaDoc blocks for needed elements (including the page-level).

Further, I know that PDT will allow you to "Generate Element Comment" for many things through the Source menu.

Is there an Eclipse plug-in out there (or perhaps it exists standard in PDT and I've just missed it) that will allow you to add PHPDoc Blocks for all/some of the supported elements in a given file?

Answer

myselfhimself picture myselfhimself · Aug 20, 2010

place your text cursor right above your function, class or whatever, type /** and press enter and you'll have a beginning of PHPDoc written. Eg.

/**
 * 
 * Enter description here ...
 * @param unknown_type $book
 * @param unknown_type $product
 */

You can then write @ inside the comments, and use @ followed by ctrl+space to get auto-completion hints for PHPDoc tags.