private static function _createScopeMap(&$tokens, $tokenizer, $eolChar)
{
if (PHP_CODESNIFFER_VERBOSITY > 1) {
echo "\t*** START SCOPE MAP ***" . PHP_EOL;
}
$numTokens = count($tokens);
for ($i = 0; $i < $numTokens; $i++) {
// Check to see if the current token starts a new scope.
if (isset($tokenizer->scopeOpeners[$tokens[$i]['code']]) === true) {
if (PHP_CODESNIFFER_VERBOSITY > 1) {
$type = $tokens[$i]['type'];
$content = PHP_CodeSniffer::prepareForOutput($tokens[$i]['content']);
echo "\tStart scope map at {$i}:{$type} => {$content}" . PHP_EOL;
}
if (isset($tokens[$i]['scope_condition']) === true) {
if (PHP_CODESNIFFER_VERBOSITY > 1) {
echo "\t* already processed, skipping *" . PHP_EOL;
}
continue;
}
$i = self::_recurseScopeMap($tokens, $numTokens, $tokenizer, $eolChar, $i);
}
//end if
}
//end for
if (PHP_CODESNIFFER_VERBOSITY > 1) {
echo "\t*** END SCOPE MAP ***" . PHP_EOL;
}
}