Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
44 | public function process(File $phpcsFile, $stackPtr) |
||
45 | { |
||
46 | $tokens = $phpcsFile->getTokens(); |
||
47 | $varName = ltrim($tokens[$stackPtr]['content'], '$'); |
||
48 | |||
49 | if ( |
||
50 | !in_array($varName, $this->allowedNames) |
||
51 | && preg_match('/^_/', $varName) |
||
52 | ) { |
||
53 | $phpcsFile->addWarning( |
||
54 | 'Variable names may not start with an underscore', |
||
55 | $stackPtr, |
||
56 | 'IllegalVariableNameUnderscore' |
||
57 | ); |
||
61 |