你如何在线记录你的PHP函数和类? [英] How do you document your PHP functions and classes inline?
问题描述
/ **
*这是下面的类的描述。
*
* @package my-package
* @subpackage my-subpackage
* @author my-name
* @version my-version
* ...
* /
class orderActions {
...
什么是最好和最广泛接受的内联文档形式?有没有自动生成这些文档的工具,还是手工完成?
我对生成手册不感兴趣 - 我想知道如何生成上述代码注释类型或内联文档。
PHPDoc ,就像您发布的一样,是广泛接受的PHP文档形式。
您可以使用 Doxygen 自动生成文档。
编辑:在代码中生成内联文档方面,我从来没有遇到过一个可以从外部处理项目的工具。通常情况下,IDE在您的代码中生成一个模板。
Eclipse实际上是一个体面的工作(这是我喜欢的几件事之一Eclipse),我相信Netbeans也是如此。任何主要的IDE都有可能有助于这种类型的模板生成。
I know there are many different standards for PHP code inline documentation. Here's what I mean by inline documentation, and please correct me if there is a better term:
/**
* This is the description for the class below.
*
* @package my-package
* @subpackage my-subpackage
* @author my-name
* @version my-version
* ...
*/
class orderActions {
...
What is the best and most widely-accepted form of inline documentation? Are there any tools to auto-generate such documentation, or does it have to be done by hand?
I'm not interested in generating manuals -- I want to know how to generate the type of code commenting above, or "inline documentation."
PHPDoc, like what you've posted, is a widely accepted form of PHP documentation.
You can use Doxygen to auto-generate the docs.
Edit: In terms of generating in-line documentation in your code, I have never come across a tool that will go back and do this externally for a project. It's generally left in the realm of the IDE to generate a template while you code.
Eclipse actually does a decent job of this (it's one of the few things I like about Eclipse) and I believe Netbeans does as well. Any major IDE will likely have functionality to assist with this type of template generation.
这篇关于你如何在线记录你的PHP函数和类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!