getTokens(); if (preg_match('/^\$[_A-Z0-9]+$/', $tokens[$stackPtr]['content'])) { $phpcsFile->addError( 'Usage of global variables is not allowed: ' . $tokens[$stackPtr]['content'], $stackPtr, 'ERROR' ); return; } } }