LinuxCommandLibrary

phpdoc

TLDR

Generate documentation

$ phpdoc -d [src/] -t [docs/]
copy
Specify config file
$ phpdoc -c [phpdoc.xml]
copy
Generate with specific template
$ phpdoc -d [src/] -t [docs/] --template="clean"
copy
Parse single file
$ phpdoc -f [file.php] -t [docs/]
copy

SYNOPSIS

phpdoc [options]

DESCRIPTION

phpDocumentor (phpdoc) generates API documentation from PHP source code. It parses DocBlock comments to create navigable HTML documentation.

PARAMETERS

-d, --directory path

Source directory.
-f, --filename file
Single file to parse.
-t, --target path
Output directory.
-c, --config file
Configuration file.
--template name
Template to use.
--ignore pattern
Patterns to ignore.

EXAMPLES

$ # Basic documentation
phpdoc -d ./src -t ./docs

# With configuration
phpdoc -c phpdoc.dist.xml

# Ignore tests
phpdoc -d ./src -t ./docs --ignore="tests/*"

# Verbose output
phpdoc -v -d ./src -t ./docs
copy

DOCBLOCK FORMAT

$ /**
 * Short description.
 *
 * Long description.
 *
 * @param string $name The name
 * @return bool Success status
 * @throws Exception On failure
 */
copy

CONFIGURATION (phpdoc.xml)

$ <?xml version="1.0"?>
<phpdocumentor>
    <paths>
        <output>docs</output>
    </paths>
    <source>
        <path>src</path>
    </source>
</phpdocumentor>
copy

CAVEATS

Requires proper DocBlocks. Large projects take time to process. Template quality varies.

HISTORY

phpDocumentor was created by Joshua Eichorn and is now maintained by Mike van Riel and the community.

SEE ALSO

doxygen(1), php(1), composer(1)

Copied to clipboard