phpdocphpdocumentor2

phpdocumentor @example number of line


I'm wondering how to use this. I'm trying to use this: https://www.phpdoc.org/docs/latest/references/phpdoc/tags/example.html

I'm using it like this:

/**
  * Format date/timestamp to localized format
  *
  * @example site/modules/KeyAgencyGeneral/Helper/Page.php 247 16 my description
  */

The starting line does work, but the number of lines doesn't, it's displayed as part of the description.

In the documentation it says to use it like this:

@example [location] [<start-line> [<number-of-lines>] ] [<description>]

When I try brackets it doesn't work at all, so I don't know how to limit the amount of lines displayed.

(side question: is it possible to enable highlighting in the example, or display line numbers?)


Solution

  • In:

    >php bin\phpDocumentor.phar -V
    phpDocumentor version v2.8.5
    

    It works very good:)

    For example:

    /**
     * configure the system
     * @example BillingCommand.php  98 3 some Date methods
     */
    protected function configure()
    {
    ...........
    

    you have got a three lines from 98:

    enter image description here

    (phpDocumentor finds example in source file’s folder)

    To enable highlighting in the example, or display line numbers you must edit the templates used to render documentation. Copy and modify one....