apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Generator

Source Location: /PHP_CodeSniffer-3.1.1/src/Generators/Generator.php

Class Overview


The base class for all PHP_CodeSniffer documentation generators.


Author(s):

Copyright:

  • 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)

Variables

Methods


Child classes:

Markdown
A doc generator that outputs documentation in Markdown format.
HTML
A doc generator that outputs documentation in one big HTML file.
Text
A doc generator that outputs text-based documentation.

Inherited Variables

Inherited Methods


Class Details

[line 19]
The base class for all PHP_CodeSniffer documentation generators.

Documentation generators are used to print documentation about code sniffs in a standard.



[ Top ]


Class Variables

$docFiles = array()

[line 34]

XML documentation files used to produce the final output.
  • Access: public

Type:   string[]


[ Top ]

$ruleset =  null

[line 27]

The ruleset used for the run.
  • Access: public

Type:   \PHP_CodeSniffer\Ruleset


[ Top ]



Method Detail

__construct (Constructor)   [line 44]

Generator __construct( Ruleset $ruleset)

Constructs a doc generator.
  • See: generate()
  • Access: public

Parameters:

\PHP_CodeSniffer\Ruleset   $ruleset   —  The ruleset used for the run.

[ Top ]

generate   [line 92]

void generate( )

Generates the documentation for a standard.

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.

  • See: processSniff()
  • Access: public

Overridden in child classes as:

Markdown::generate()
Generates the documentation for a standard.
HTML::generate()
Generates the documentation for a standard.

[ Top ]

getTitle   [line 75]

string getTitle( DOMNode \$doc, \DOMNode $doc)

Retrieves the title of the sniff from the DOMNode supplied.
  • Access: protected

Parameters:

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

[ Top ]

processSniff   [line 116]

void processSniff( DOMNode \$doc, \DOMNode $doc)

Process the documentation for a single sniff.

Doc generators must implement this function to produce output.

  • See: generate()
  • Abstract:
  • Access: protected

Overridden in child classes as:

Markdown::processSniff()
Process the documentation for a single sniff.
HTML::processSniff()
Process the documentation for a single sniff.
Text::processSniff()
Process the documentation for a single sniff.

Parameters:

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

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:27:32 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.