Skip to content

Commit 02abdba

Browse files
authored
Merge pull request #768 from Automattic/feature/declarationcompatibility-performance-fix
2 parents 3320ef7 + 234be58 commit 02abdba

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ class DeclarationCompatibilitySniff extends AbstractScopeSniff {
2424
*/
2525
private $currentClass = '';
2626

27-
/**
28-
* A list of functions in the current class.
29-
*
30-
* @var string[]
31-
*/
32-
private $functionList = [];
33-
3427
/**
3528
* A list of classes and methods to check.
3629
*
@@ -211,7 +204,6 @@ protected function processTokenWithinScope( File $phpcsFile, $stackPtr, $currSco
211204
$className = $phpcsFile->getDeclarationName( $currScope );
212205

213206
if ( $className !== $this->currentClass ) {
214-
$this->loadFunctionNamesInScope( $phpcsFile, $currScope );
215207
$this->currentClass = $className;
216208
}
217209

@@ -358,28 +350,6 @@ private function generateParamList( $methodSignature ) {
358350
return $paramList;
359351
}
360352

361-
/**
362-
* Extracts all the function names found in the given scope.
363-
*
364-
* @param File $phpcsFile The current file being scanned.
365-
* @param int $currScope A pointer to the start of the scope.
366-
*
367-
* @return void
368-
*/
369-
protected function loadFunctionNamesInScope( File $phpcsFile, $currScope ) {
370-
$this->functionList = [];
371-
$tokens = $phpcsFile->getTokens();
372-
373-
for ( $i = ( $tokens[ $currScope ]['scope_opener'] + 1 ); $i < $tokens[ $currScope ]['scope_closer']; $i++ ) {
374-
if ( $tokens[ $i ]['code'] !== T_FUNCTION ) {
375-
continue;
376-
}
377-
378-
$next = $phpcsFile->findNext( T_STRING, $i );
379-
$this->functionList[] = trim( $tokens[ $next ]['content'] );
380-
}
381-
}
382-
383353
/**
384354
* Do nothing outside the scope. Has to be implemented accordingly to parent abstract class.
385355
*

0 commit comments

Comments
 (0)