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 DOMElement supplied.
- 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
= []
$ruleset
The ruleset used for the run.
public
Ruleset
$ruleset
= null
Methods
__construct()
Constructs a doc generator.
public
__construct(Ruleset $ruleset) : mixed
Parameters
- $ruleset : Ruleset
-
The ruleset used for the run.
Tags
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
processSniff()
Process the documentation for a single sniff.
public
processSniff(DOMElement $doc) : void
Parameters
- $doc : DOMElement
-
The DOMElement 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(DOMElement $node) : string
Parameters
- $node : DOMElement
-
The DOMElement object for the code comparison block.
Tags
Return values
stringgetFormattedTextBlock()
Format a text block found in a standard.
protected
getFormattedTextBlock(DOMElement $node) : string
Parameters
- $node : DOMElement
-
The DOMElement object for the text block.
Tags
Return values
stringgetFormattedTitle()
Format the title area for a single sniff.
protected
getFormattedTitle(DOMElement $doc) : string
Parameters
- $doc : DOMElement
-
The DOMElement object for the sniff. It represents the "documentation" tag in the XML standard file.
Tags
Return values
stringgetTitle()
Retrieves the title of the sniff from the DOMElement supplied.
protected
getTitle(DOMElement $doc) : string
Parameters
- $doc : DOMElement
-
The DOMElement object for the sniff. It represents the "documentation" tag in the XML standard file.
Return values
stringcodeTitleToLines()
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
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
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.