Documentation

Text extends Generator
in package

Table of Contents

Properties

$docFiles  : array<string|int, string>
XML documentation files used to produce the final output.
$ruleset  : Ruleset
The ruleset used for the run.

Methods

__construct()  : mixed
Constructs a doc generator.
generate()  : void
Generates the documentation for a standard.
processSniff()  : void
Process the documentation for a single sniff.
getFormattedCodeComparisonBlock()  : string
Format a code comparison block found in a standard.
getFormattedTextBlock()  : string
Format a text block found in a standard.
getFormattedTitle()  : string
Format the title area for a single sniff.
getTitle()  : string
Retrieves the title of the sniff from the DOMNode supplied.
printCodeComparisonBlock()  : void
Print a code comparison block found in a standard.
printTextBlock()  : void
Print a text block found in a standard.
printTitle()  : void
Prints the title area for a single sniff.
codeTitleToLines()  : array<string|int, string>
Retrieve a code block title and split it into lines for use in an ASCII table.
codeToLines()  : array<string|int, string>
Retrieve a code block contents and split it into lines for use in an ASCII table.
linesToTableRows()  : string
Transform two sets of text lines into rows for use in an ASCII table.

Properties

$docFiles

XML documentation files used to produce the final output.

public array<string|int, string> $docFiles = []

Methods

__construct()

Constructs a doc generator.

public __construct(Ruleset $ruleset) : mixed
Parameters
$ruleset : Ruleset

The ruleset used for the run.

Tags
see
generate()

generate()

Generates the documentation for a standard.

public generate() : void

It's probably wise for doc generators to override this method so they have control over how the docs are produced. Otherwise, the processSniff method should be overridden to output content for each sniff.

Tags
see
processSniff()

processSniff()

Process the documentation for a single sniff.

public processSniff(DOMNode $doc) : void
Parameters
$doc : DOMNode

The DOMNode object for the sniff. It represents the "documentation" tag in the XML standard file.

getFormattedCodeComparisonBlock()

Format a code comparison block found in a standard.

protected getFormattedCodeComparisonBlock(DOMNode $node) : string
Parameters
$node : DOMNode

The DOMNode object for the code comparison block.

Tags
since
3.12.0

Replaces the deprecated Text::printCodeComparisonBlock() method.

Return values
string

getFormattedTextBlock()

Format a text block found in a standard.

protected getFormattedTextBlock(DOMNode $node) : string
Parameters
$node : DOMNode

The DOMNode object for the text block.

Tags
since
3.12.0

Replaces the deprecated Text::printTextBlock() method.

Return values
string

getFormattedTitle()

Format the title area for a single sniff.

protected getFormattedTitle(DOMNode $doc) : string
Parameters
$doc : DOMNode

The DOMNode object for the sniff. It represents the "documentation" tag in the XML standard file.

Tags
since
3.12.0

Replaces the deprecated Text::printTitle() method.

Return values
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

Use Text::getFormattedCodeComparisonBlock() instead.

Parameters
$node : DOMNode

The DOMNode object for the code comparison block.

Tags
codeCoverageIgnore

printTextBlock()

Print a text block found in a standard.

protected printTextBlock(DOMNode $node) : void

Use Text::getFormattedTextBlock() instead.

Parameters
$node : DOMNode

The DOMNode object for the text block.

Tags
codeCoverageIgnore

printTitle()

Prints the title area for a single sniff.

protected printTitle(DOMNode $doc) : void

Use Text::getFormattedTitle() instead.

Parameters
$doc : DOMNode

The DOMNode object for the sniff. It represents the "documentation" tag in the XML standard file.

Tags
codeCoverageIgnore

codeTitleToLines()

Retrieve a code block title and split it into lines for use in an ASCII table.

private codeTitleToLines(DOMElement $codeElm) : array<string|int, string>
Parameters
$codeElm : DOMElement

The DOMElement object for a code block.

Tags
since
3.12.0
Return values
array<string|int, string>

codeToLines()

Retrieve a code block contents and split it into lines for use in an ASCII table.

private codeToLines(DOMElement $codeElm) : array<string|int, string>
Parameters
$codeElm : DOMElement

The DOMElement object for a code block.

Tags
since
3.12.0
Return values
array<string|int, string>

linesToTableRows()

Transform two sets of text lines into rows for use in an ASCII table.

private linesToTableRows(array<string|int, string> $column1Lines, array<string|int, string> $column2Lines) : string

The sets may not contains an equal amount of lines, while the resulting rows should.

Parameters
$column1Lines : array<string|int, string>

Lines of text to place in column 1.

$column2Lines : array<string|int, string>

Lines of text to place in column 2.

Return values
string
On this page

Search results