How to create PHP documentation in PhpStorm
PhpStorm displays your own code documentation in the code assist. But what if you wanted to create a separate documentation you can hand out or integrate into your website? Then you should use phpDocumentor. You can configure and run phpDocumentor directly from PhpStorm as an external tool. Here is what you have to do:
File -> Settings -> Select External Tools -> Add…

Screenshot showing how to install phpDocumentor in phpStorm as an external tool.
Provide the following data:
Name: phpDocumentor
This name will show up in your Tools Menu. If you fill in a group such as PHP, then the entry will become a submenu of PHP.
Program: <pathToPhp.exe>
Fill in the path to your PHP executable, e.g. C:\Program Files\PHP\php.exe
Parameters: phpdoc -d “<pathToSourceDirectory>” -t “<pathToDestinationDirectory>” -o HTML:Smarty:PHP
The source directory is the one you want to document, e.g. where your php files reside in. The destination directory is where you want the documentation to be created in. Please note, that paths are given without th a trailing slash and in case your paths contain spaces it is important to enclose the parameter in quotes. For more information about the parameters see the phpDocumentor tutorial.
Working Directory: <pathToPhpDocumentor>
Fill in the path to your phpDocumentor directory, e.g. C:\Documents and Settings\Speich\My Documents\Website Tools\PhpDocumentor
In case you also wanted to create documentation for your JavaScript code, you should read the blog entry ‘How to create JavaScript documentation in PhpStorm‘.
