BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
PHP_CodeSniffer\Ruleset Class Reference

Public Member Functions

 __construct (Config $config)
 
 explain ()
 
 processRuleset ($rulesetPath, $depth=0)
 
 registerSniffs ($files, $restrictions, $exclusions)
 
 populateTokenListeners ()
 
 setSniffProperty ($sniffClass, $name, $value)
 
 getIgnorePatterns ($listener=null)
 
 getIncludePatterns ($listener=null)
 

Public Attributes

 $name = ''
 
 $paths = array()
 
 $ignorePatterns = array()
 
 $includePatterns = array()
 
 $sniffs = array()
 
 $sniffCodes = array()
 
 $tokenListeners = array()
 
 $ruleset = array()
 

Protected Attributes

 $rulesetDirs = array()
 

Constructor & Destructor Documentation

PHP_CodeSniffer\Ruleset::__construct ( Config  $config)

Initialise the ruleset that the run will use.

Parameters
\PHP_CodeSniffer\Config$configThe config data for the run.
Returns
void

Member Function Documentation

PHP_CodeSniffer\Ruleset::explain ( )

Prints a report showing the sniffs contained in a standard.

Returns
void
PHP_CodeSniffer\Ruleset::getIgnorePatterns (   $listener = null)

Gets the array of ignore patterns.

Optionally takes a listener to get ignore patterns specified for that sniff only.

Parameters
string$listenerThe listener to get patterns for. If NULL, all patterns are returned.
Returns
array
PHP_CodeSniffer\Ruleset::getIncludePatterns (   $listener = null)

Gets the array of include patterns.

Optionally takes a listener to get include patterns specified for that sniff only.

Parameters
string$listenerThe listener to get patterns for. If NULL, all patterns are returned.
Returns
array
PHP_CodeSniffer\Ruleset::populateTokenListeners ( )

Populates the array of PHP_CodeSniffer_Sniff's for this file.

Returns
void
Exceptions
RuntimeExceptionIf sniff registration fails.
PHP_CodeSniffer\Ruleset::processRuleset (   $rulesetPath,
  $depth = 0 
)

Processes a single ruleset and returns a list of the sniffs it represents.

Rules founds within the ruleset are processed immediately, but sniff classes are not registered by this method.

Parameters
string$rulesetPathThe path to a ruleset XML file.
int$depthHow many nested processing steps we are in. This is only used for debug output.
Returns
string[]
Exceptions
RuntimeExceptionIf the ruleset path is invalid.
PHP_CodeSniffer\Ruleset::registerSniffs (   $files,
  $restrictions,
  $exclusions 
)

Loads and stores sniffs objects used for sniffing files.

Parameters
array$filesPaths to the sniff files to register.
array$restrictionsThe sniff class names to restrict the allowed listeners to.
array$exclusionsThe sniff class names to exclude from the listeners list.
Returns
void
PHP_CodeSniffer\Ruleset::setSniffProperty (   $sniffClass,
  $name,
  $value 
)

Set a single property for a sniff.

Parameters
string$sniffClassThe class name of the sniff.
string$nameThe name of the property to change.
string$valueThe new value of the property.
Returns
void

The documentation for this class was generated from the following file: