BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
PHP_CodeSniffer\Sniffs Namespace Reference

Classes

class  AbstractPatternSniff
 
class  AbstractScopeSniff
 
class  AbstractVariableSniff
 
interface  Sniff
 

Detailed Description

Processes pattern strings and checks that the code conforms to the pattern.

Author
Greg Sherwood gsher.nosp@m.wood.nosp@m.@squi.nosp@m.z.ne.nosp@m.t

Allows tests that extend this class to listen for tokens within a particular scope.

Below is a test that listens to methods that exist only within classes: class ClassScopeTest extends PHP_CodeSniffer_Standards_AbstractScopeSniff { public function __construct() { parent::__construct(array(T_CLASS), array(T_FUNCTION)); }

protected function processTokenWithinScope( $phpcsFile, $) { $className = $phpcsFile->getDeclarationName($currScope); echo 'encountered a method within class '.$className; } }

Author
Greg Sherwood gsher.nosp@m.wood.nosp@m.@squi.nosp@m.z.ne.nosp@m.t

A class to find T_VARIABLE tokens.

This class can distinguish between normal T_VARIABLE tokens, and those tokens that represent class members. If a class member is encountered, then the processMemberVar method is called so the extending class can process it. If the token is found to be a normal T_VARIABLE token, then processVariable is called.

Author
Greg Sherwood gsher.nosp@m.wood.nosp@m.@squi.nosp@m.z.ne.nosp@m.t

Represents a PHP_CodeSniffer sniff for sniffing coding standards.

A sniff registers what token types it wishes to listen for, then, when PHP_CodeSniffer encounters that token, the sniff is invoked and passed information about where the token was found in the stack, and the PHP_CodeSniffer file in which the token was found.

Author
Greg Sherwood gsher.nosp@m.wood.nosp@m.@squi.nosp@m.z.ne.nosp@m.t