You should try the Api Generator plug-in ( presented here ), used to support the official CakePHP API .
It uses the Reflection class (available in PHP 5.2 and later) to dynamically parse comments in a block of code, which means you donβt need to regenerate the documentation for every change you make.
There are also several additional features, such as indexing the search, calculating the coverage of the document with your code, and the ability to use Markdown in your comments on the document block to generate HTML in your documentation.
Instead, you can always use universal solutions that apply to any base of PHP code, for example, phpDocumentor or doxygen .
You will need to add docblocks to your code with the appropriate tags for any of these solutions to work (some IDEs can generate them for you). The core CakePHP code (and related documentation ) can be used as a good example of what is required.
A few of the subtle standards that I noticed, the CakePHP team uses when documenting code:
- Never back down from a docblock comment, even inside a class. This allows you to scroll through the code scan by docblock, and also allows you to enter the horizontal width of each line for input (usually about 100 characters).
- End each sentence with a period (or period) as this is a good signal to let you know if each part of the documentation is complete and well thought out.
source share