1

我使用 Notation 这个词是因为 fabien potencier 有自己的生成器,但我找不到它用于注释的符号(或语法,如果你愿意的话)。

http://fabien.potencier.org/article/63/sami-yet-another-php-api-documentation-generator

另外,我在哪里可以找到使用文档生成器的注释符号?看起来像 PhpDocumentor 但我不能确定。

symfony 使用这个生成器吗?

4

1 回答 1

2

Symfony 1.4(几乎)肯定使用 phpDocumentor。

我从未尝试过 Sami,但我想它可以在 Symfony 1.4 上运行。

关于注释符号,我认为 Sami、phpDoc 等几乎相同。它们都使用DocBlock ,例如

/**
  * This is the short description for a DocBlock.
  *
  * This is the long description for a DocBlock. This text may contain
  * multiple lines and even some _markdown_.
  *
  * * Markdown style lists function too
  * * Just try this out once
  *
  * The section after the long description contains the tags; which provide
  * structured meta-data concerning the given element.
  *
  * @author  Mike van Riel <mike.vanriel@naenius.com>
  *
  * @since 1.0
  *
  * @param int    $example  This is an example function/method parameter description.
  * @param string $example2 This is a second example.
  */

我在 Symfony 2.0 中随机上课:

/**
 * Renders a Controller and returns the Response content.
 *
 * Note that this method generates an esi:include tag only when both the standalone
 * option is set to true and the request has ESI capability (@see Symfony\Component\HttpKernel\HttpCache\ESI).
 *
 * Available options:
 *
 *  * attributes: An array of request attributes (only when the first argument is a controller)
 *  * query: An array of request query parameters (only when the first argument is a controller)
 *  * ignore_errors: true to return an empty string in case of an error
 *  * alt: an alternative controller to execute in case of an error (can be a controller, a URI, or an array with the controller, the attributes, and the query arguments)
 *  * standalone: whether to generate an esi:include tag or not when ESI is supported
 *  * comment: a comment to add when returning an esi:include tag
 *
 * @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
 * @param array  $options    An array of options
 *
 * @return string The Response content
 */

还有一个来自 symfony 1.4 的:

/**
 * Initializes this sfRequest.
 *
 * Available options:
 *
 *  * formats:           The list of supported format and their associated mime-types
 *  * path_info_key:     The path info key (default to PATH_INFO)
 *  * path_info_array:   The path info array (default to SERVER)
 *  * relative_url_root: The relative URL root
 *  * http_port:         The port to use for HTTP requests
 *  * https_port:        The port to use for HTTPS requests
 *
 * @param  sfEventDispatcher $dispatcher  An sfEventDispatcher instance
 * @param  array             $parameters  An associative array of initialization parameters
 * @param  array             $attributes  An associative array of initialization attributes
 * @param  array             $options     An associative array of options
 *
 * @return bool true, if initialization completes successfully, otherwise false
 *
 * @throws <b>sfInitializationException</b> If an error occurs while initializing this sfRequest
 *
 * @see sfRequest
 */
于 2012-08-03T07:31:13.143 回答