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

Class: PHP_CodeSniffer_DocGenerators_Generator

Source Location: /PHP_CodeSniffer-0.7.0/CodeSniffer/DocGenerators/Generator.php

Class Overview


The base class for all PHP_CodeSniffer documentation generators.


Author(s):

Version:

  • Release: 0.7.0

Copyright:

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

Methods


Child classes:

PHP_CodeSniffer_DocGenerators_HTML
A doc generator that outputs documentation in one big HTML file.
PHP_CodeSniffer_DocGenerators_Text
A doc generator that outputs text-based documentation.

Inherited Variables

Inherited Methods


Class Details

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

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



[ Top ]


Method Detail

__construct (Constructor)   [line 63]

PHP_CodeSniffer_DocGenerators_Generator __construct( string $standard, [array $sniffs = array()])

Constructs a PHP_CodeSniffer_DocGenerators_Generator object.

Parameters:

string   $standard   —  The name of the coding standard to generate docs for.
array   $sniffs   —  An array of sniffs that we are limiting the generated docs to.

[ Top ]

generate   [line 109]

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.


Overridden in child classes as:

PHP_CodeSniffer_DocGenerators_HTML::generate()
Generates the documentation for a standard.

[ Top ]

getStandard   [line 92]

string getStandard( )

Retrieves the name of the standard we are generating docs for.
  • Access: protected

[ Top ]

getStandardFiles   [line 133]

array(string) getStandardFiles( )

Returns a list of paths to XML standard files for all sniffs in a standard.

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.

  • Access: protected

[ Top ]

getTitle   [line 80]

string getTitle( 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.

[ Top ]

processSniff   [line 175]

void processSniff( DOMNode $doc)

Process the documentation for a single sniff.

Doc generators should override this function to produce output.


Overridden in child classes as:

PHP_CodeSniffer_DocGenerators_HTML::processSniff()
Process the documentation for a single sniff.
PHP_CodeSniffer_DocGenerators_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.

[ Top ]


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