Skip to main content

Installation

Requirements

  • PHP 8.5+
  • Extensions: dom, libxml, simplexml

Install

git clone https://github.com/php/docbook-cs.git
cd docbook-cs

Quick start

# Copy the dist config and run from the cloned repo
cp docbookcs.xml.dist docbookcs.xml
bin/docbook-cs

Options

OptionDescription
--config=<file>Path to configuration file (default: docbookcs.xml)
--report=<format>Output format: console (default), checkstyle, json
--diff[=<file>]Restrict analysis to lines changed in a unified diff. Pass - or omit the value to read from stdin.
--colorsForce ANSI color output
--no-colorsDisable ANSI color output
-q, --quietSuppress progress output
-v, --versionShow version and exit

Exit codes

CodeMeaning
0No violations found
1One or more violations found
2Runtime error (bad config, unreadable file, etc.)