diff --git a/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php b/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php index dea566e2..7c4c47c7 100644 --- a/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php +++ b/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php @@ -24,13 +24,6 @@ class DeclarationCompatibilitySniff extends AbstractScopeSniff { */ private $currentClass = ''; - /** - * A list of functions in the current class. - * - * @var string[] - */ - private $functionList = []; - /** * A list of classes and methods to check. * @@ -211,7 +204,6 @@ protected function processTokenWithinScope( File $phpcsFile, $stackPtr, $currSco $className = $phpcsFile->getDeclarationName( $currScope ); if ( $className !== $this->currentClass ) { - $this->loadFunctionNamesInScope( $phpcsFile, $currScope ); $this->currentClass = $className; } @@ -358,28 +350,6 @@ private function generateParamList( $methodSignature ) { return $paramList; } - /** - * Extracts all the function names found in the given scope. - * - * @param File $phpcsFile The current file being scanned. - * @param int $currScope A pointer to the start of the scope. - * - * @return void - */ - protected function loadFunctionNamesInScope( File $phpcsFile, $currScope ) { - $this->functionList = []; - $tokens = $phpcsFile->getTokens(); - - for ( $i = ( $tokens[ $currScope ]['scope_opener'] + 1 ); $i < $tokens[ $currScope ]['scope_closer']; $i++ ) { - if ( $tokens[ $i ]['code'] !== T_FUNCTION ) { - continue; - } - - $next = $phpcsFile->findNext( T_STRING, $i ); - $this->functionList[] = trim( $tokens[ $next ]['content'] ); - } - } - /** * Do nothing outside the scope. Has to be implemented accordingly to parent abstract class. *