PHP Class CakePHP_Sniffs_NamingConventions_ValidVariableNameSniff

Inheritance: extends PHP_CodeSniffer_Standards_AbstractVariableSniff
Afficher le fichier Open project: cakephp/cakephp-codesniffer

Méthodes protégées

Méthode Description
_fixVar ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, string $varName ) : void
_isValidVar ( string $string, boolean $public = true ) : boolean Check that a variable is a valid shape.
processMemberVar ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void Processes class member variables.
processVariable ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void Processes this test, when one of its tokens is encountered.
processVariableInString ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void Processes the variable found within a double quoted string.

Method Details

_fixVar() protected méthode

protected _fixVar ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, string $varName ) : void
$phpcsFile PHP_CodeSniffer_File PHPCS file
$stackPtr integer The pointer
$varName string The variable name
Résultat void

_isValidVar() protected méthode

Variables in CakePHP can either be $fooBar, $FooBar, $_fooBar, or $_FooBar.
protected _isValidVar ( string $string, boolean $public = true ) : boolean
$string string The variable to check.
$public boolean Whether or not the variable is public.
Résultat boolean

processMemberVar() protected méthode

Processes class member variables.
protected processMemberVar ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$stackPtr integer The position of the current token in the stack passed in $tokens.
Résultat void

processVariable() protected méthode

Processes variables, we skip processing object properties because they could come from things like PDO which doesn't follow the normal conventions and causes additional failures.
protected processVariable ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$stackPtr integer The position of the current token in the stack passed in $tokens.
Résultat void

processVariableInString() protected méthode

Processes the variable found within a double quoted string.
protected processVariableInString ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$stackPtr integer The position of the double quoted string.
Résultat void