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. --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
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.
- A temporary
phpdocumentor.xmlis created in the cache directory. - 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.