简体   繁体   English

PHP中使用的文档注释是什么或如何使用

[英]What are or how is this documentation comments used in PHP

I often see this type of comments which are well documented. 我经常看到这类评论,有据可查。

/*
* @author      some name
* @category    Core
* @package     /dir/name
* @version     1.6.4
*/

function ... (){}

*** code here ***

I wonder since so many people are using this (most open source) 我想知道既然有这么多人在使用这个(最开源)

What are they and how I get into using this method or find out more about this kind of stuff. 它们是什么,以及我如何使用这种方法或了解有关此类内容的更多信息。

I am not looking for a quick answer, here do your research: 我不是在寻找快速解答,请在此处进行研究:

Hopefully a helpful answer, explaining what it is, what the benefits are from taking the time to write extra code etc... 希望有帮助的答案,解释它是什么,花时间编写额外的代码等有什么好处。

They are documentation tags within the comments of a PHP file. 它们是PHP文件注释中的文档标记。 Commonly used with applications that generate documentation such as PHP Documentator 通常与生成文档的应用程序一起使用,例如PHP Documentator

From the intro : 从简介:

phpDocumentor 2 is a tool with which it is possible to generate documentation from your PHP source code. phpDocumentor 2是一个可以从您的PHP源代码生成文档的工具。 With this documentation you can provide your consumers with more information regarding the functionality embedded within your source and not only what is usable to them from your user interface. 通过此文档,您可以为消费者提供有关源中嵌入的功能的更多信息,而不仅是从用户界面中可以使用的功能。

They are called annotations and are usually (but not only) used for documentation purposes. 它们被称为注释 ,通常(但不仅限于)用于文档目的。 Try to read this: http://en.wikipedia.org/wiki/PHPDoc 尝试阅读以下内容: http : //en.wikipedia.org/wiki/PHPDoc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM