LinuxCommandLibrary

phpdoc

generates API documentation from PHP source code

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.

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

$
# DOCBLOCK FORMAT
copy
/**
* Short description.
*
* Long description.
*
* @param string $name The name
* @return bool Success status
* @throws Exception On failure
*/
$
# CONFIGURATION (phpdoc.xml)
copy
<?xml version="1.0"?>
<phpdocumentor>
<paths>
<output>docs</output>
</paths>
<source>
<path>src</path>
</source>
</phpdocumentor>
$
# 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)
copy

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community