/** * Processes the tokens within the scope. * @param PHP_CodeSniffer_File $phpcsFile The file being processed. * @param int $stackPtr The position where this token was * found. * @param int $currScope The position of the current scope. * @return void */ protected function processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $currScope) { if ($namespace = $phpcsFile->findNext(T_NAMESPACE, 1)) { $tokens = $phpcsFile->getTokens(); if (isset($tokens[$namespace + 2]) && in_array($tokens[$namespace + 2]['content'], ['spec', 'spec_nightly'])) { return; } } parent::processTokenWithinScope($phpcsFile, $stackPtr, $currScope); }