PHP_CodeSniffer_DocGenerators_Markdown
extends PHP_CodeSniffer_DocGenerators_Generator
in package
A doc generator that outputs documentation in Markdown format.
Tags
Table of Contents
- $_sniffs : string
- An array of sniffs that we are limiting the generated docs to.
- $_standard : string
- The name of the coding standard we are generating docs for.
- __construct() : mixed
- Constructs a PHP_CodeSniffer_DocGenerators_Generator object.
- generate() : void
- Generates the documentation for a standard.
- getStandard() : string
- Retrieves the name of the standard we are generating docs for.
- getStandardFiles() : array<string|int, string>
- Returns a list of paths to XML standard files for all sniffs in a standard.
- getTitle() : string
- Retrieves the title of the sniff from the DOMNode supplied.
- printCodeComparisonBlock() : void
- Print a code comparison block found in a standard.
- printFooter() : void
- Print the markdown footer.
- printHeader() : void
- Print the markdown header.
- printTextBlock() : void
- Print a text block found in a standard.
- processSniff() : void
- Process the documentation for a single sniff.
Properties
$_sniffs
An array of sniffs that we are limiting the generated docs to.
private
string
$_sniffs
= array()
If this array is empty, docs are generated for all sniffs in the supplied coding standard.
$_standard
The name of the coding standard we are generating docs for.
private
string
$_standard
= ''
Methods
__construct()
Constructs a PHP_CodeSniffer_DocGenerators_Generator object.
public
__construct(string $standard[, array<string|int, mixed> $sniffs = array() ]) : mixed
Parameters
- $standard : string
-
The name of the coding standard to generate docs for.
- $sniffs : array<string|int, mixed> = array()
-
An array of sniffs that we are limiting the generated docs to.
Tags
Return values
mixed —generate()
Generates the documentation for a standard.
public
generate() : void
Tags
Return values
void —getStandard()
Retrieves the name of the standard we are generating docs for.
protected
getStandard() : string
Return values
string —getStandardFiles()
Returns a list of paths to XML standard files for all sniffs in a standard.
protected
getStandardFiles() : array<string|int, string>
Any sniffs that do not have an XML standard file are obviously not included in the returned array. If documentation is only being generated for some sniffs (ie. $this->_sniffs is not empty) then all others sniffs will be filtered from the results as well.
Return values
array<string|int, string> —getTitle()
Retrieves the title of the sniff from the DOMNode supplied.
protected
getTitle(DOMNode $doc) : string
Parameters
- $doc : DOMNode
-
The DOMNode object for the sniff. It represents the "documentation" tag in the XML standard file.
Return values
string —printCodeComparisonBlock()
Print a code comparison block found in a standard.
protected
printCodeComparisonBlock(DOMNode $node) : void
Parameters
- $node : DOMNode
-
The DOMNode object for the code comparison block.
Return values
void —printFooter()
Print the markdown footer.
protected
printFooter() : void
Return values
void —printHeader()
Print the markdown header.
protected
printHeader() : void
Return values
void —printTextBlock()
Print a text block found in a standard.
protected
printTextBlock(DOMNode $node) : void
Parameters
- $node : DOMNode
-
The DOMNode object for the text block.
Return values
void —processSniff()
Process the documentation for a single sniff.
protected
processSniff(DOMNode $doc) : void
Parameters
- $doc : DOMNode
-
The DOMNode object for the sniff. It represents the "documentation" tag in the XML standard file.