Skip to content

Configuration File

The configuration file should be named .dog.yml and be placed in the root directory of your project. The file format is yaml.

The following options are available:

title

Title for the index page of your project. Type: string. Default: 'Api Reference'.

Example:

title: 'Overview'

srcPaths

List of relative or absolute paths to a source directory mapped to a list of matching (true) or not matching (false) patterns (regex or string). Type: array. Default: ['src' => ['/.*\.php$/' => true]]

See symfony/finder documentation for more details about pattern types.

Example:

srcPaths:
  'src/':
    '/.*\.php$/': true # include all files with php file extension
    '/\/migrations\//': false # exclude all migrations directories

rules

Add new or change default validation rules. Type: array. Default: default set of rules.

Change a default rule

You should only set issueLevel and match. Both will override the default values. The id must match the id of the default rules.

Disable a default rule

Simply set issueLevel to 'ignore'. The id must match the id of the default rules.

Add a new rule

The id of the rule has to be unique. You must set class to the full qualified class name of the rule. Default value for issueLevel is 'error'. Default value for match is [].

rules:
  # ignore default rule
  TypeMissingRule:
    issueLevel: ignore
  # change issue level of default rule
  PublicFileDocBlockMissingRule:
    issueLevel: warning
  # add new rule
  PublicTypeMissingRule:
    class: \Klitsche\Dog\Analyzer\Rules\TypeMissingRule
    issueLevel: error
    match:
      isPublic: true
      isInternal: false

enrichers

Configure enrichers to add extra data to project and element items. Type: array. Default: []

Hint

See enrichers for more details on how they work and for a list of bundled enrichers.

enrichers:
  # id of enricher
  phploc:
    # full qualified class name
    class: \Klitsche\Dog\Enrichers\PHPLOC\PHPLOCEnricher
    # parameters
    file: phploc.json

printerClass

Full qualified class name of the template printer class. Type: string. Default: 'Klitsche\Dog\Printer\Markdown\Printer'

Hint

See printers for more details on how they work.

Example:

printerClass: 'Klitsche\Dog\Printer\Markdown\Printer'

printerConfig

Provide assoc array with custom printer configuration matching the configured printer class. Type: array. Default: []

outputPath

Relative or absolute path to output directory Type: string. Default: 'docs/api'

Warning

dog does not purge the output directory before printing. You have to take care of it yourself.

Example:

outputDir: 'docs/api'

debug

Enable or disable debug mode. Type: bool. Default: false.

debug: false