你如何记录你的PHP函数和类的内联? [英] How do you document your PHP functions and classes inline?
问题描述
我知道PHP代码内联文档有很多不同的标准。这里是我的意思是通过内联文档,如果有一个更好的术语,请纠正我:
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 ,就像您发布的,是一种广泛接受的PHP文档形式。
PHPDoc, like what you've posted, is a widely accepted form of PHP documentation.
您可以使用 Doxygen 自动生成文档。
You can use Doxygen to auto-generate the docs.
编辑:关于在代码中生成嵌入式文档,我从来没有遇到过一个工具,它会返回并为项目外部执行。它通常留在IDE的领域,以生成一个模板,而你编码。
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实际上做了一个体面的工作,这是我喜欢的几件事Eclipse)和我相信Netbeans也一样。任何主要的IDE可能具有协助这种类型的模板生成的功能。
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屋!