docs
Generates API documentation using phpDocumentor.
Description
The docs
command builds HTML documentation using phpDocumentor.
It generates documentation from:
- PSR-4 paths declared in composer.json (API docs)
- Selected source directory (guide docs)
Usage
composer docs
composer dev-tools docs
composer docs [options]
composer dev-tools docs -- [options]
vendor/bin/dev-tools docs [options]
Options
--target, -t(optional)- Path to the output directory for the generated HTML documentation.
Default:
.dev-tools. --source, -s(optional)- Path to the source directory for the guide documentation.
Default:
docs. --template(optional)- Path to the template directory for the generated HTML documentation.
Default:
vendor/fast-forward/phpdoc-bootstrap-template. --cache-dir(optional)- Path to the cache directory for phpDocumentor.
Default:
.dev-tools/cache/phpdoc. --cache- Force phpDocumentor caching on for this run.
--no-cache- Force phpDocumentor caching off for this run.
--progress- Enable progress output from phpDocumentor.
--json- Emit a structured machine-readable payload instead of the normal terminal output.
--pretty-json- Emit the same structured payload with indentation for terminal inspection.
Examples
Generate docs with defaults:
composer docs
Generate to custom directory:
composer docs --target=dist/docs
Use custom source:
composer docs --source=docs/user-guide
Generate without cache:
composer docs --no-cache
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success. Documentation generated. |
| 1 | Failure. Generation error or source not found. |
Behavior
docs/must exist unless you pass another--sourcedirectory.- API pages are built from the PSR-4 paths declared in
composer.json. - Guide pages are built from the selected source directory.
- Cache stays enabled by default; omit both flags to keep the command default,
pass
--cacheto force it on, and pass--no-cacheto force it off. - When
--cache-diris omitted, phpDocumentor keeps its default cache directory. The option only affects phpDocumentor when caching is enabled. - A temporary
phpdocumentor.xmlis created for the run and uses the configured cache directory only when caching stays enabled. - Progress output is disabled by default; use
--progressto re-enable it in text mode. --jsonand--pretty-jsonsuppress phpDocumentor progress rendering so the structured payload stays readable.- Markers: TODO, FIXME, BUG, HACK are included.