Skip to content

Usage

NOTE

The examples assume that CodPhp is run from the project root directory (recommended).

Without a Configuration File

Examples

The simplest command is to provide the namespace to document.

shell
php ./vendor/bin/cod-php Namespace\\Project

Set the output directory.

shell
php ./vendor/bin/cod-php Namespace\\Project -o ./docs/src/api

Link to source code in a repository.

shell
php ./vendor/bin/cod-php Namespace\\Project -b https://example.com/repository/example-project/tree/main/src

Command-line Options

OptionShortcutDescriptionConfiguration Equivalent
--baseUrl=URL-bBase URL for source code links.baseUrl
--config=PATH-cPath to configuration file.no equivalent
--exclude=LIST-eComma separated list of path(s) to exclude from source files.exclude
--language=LANG-pPHP manual language; 'en'|'de'|'fr'|'it'|'tr'|'uk'|'zh'|'ja'|'pt_BR'|'ru'.language
--inheritance=WORD-iLevel of inheritance to show; 'All'|'Namespace'|'Class'.inheritance
--error-level=WORD-lError reporting level; 'Error'|'Warning'|'Notice'|'None'.errorLevel
--match=LIST-mComma separated list of pattern(s) to match for source files.match
--output=PATH-oOutput directory.outputDir
--quiet-qShow only console errors.verbosity (VERBOSITY_QUIET)
--silentSuppress all output.verbosity (VERBOSITY_SILENT)
--template=PATH-tTemplate directory.templateDir
--renderer=FQCN-rTemplate renderer.templateRenderer
-vVerbose output.verbosity (VERBOSITY_VERBOSE)
--writer=FQCN-wFQCN of the Writer class.writer

NOTE

--quiet/-q, --silent, and -q are mutually exclusive; only one or none may be specified.

With a Configuration File

shell
php ./vendor/bin/cod-php

NOTE

Command-line argument or option can be used with, and will override settings in, a configuration file.