|
9 | 9 |
|
10 | 10 | use PHP_CodeSniffer\Files\File; |
11 | 11 | use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; |
| 12 | +use PHPCSUtils\Utils\FunctionDeclarations; |
| 13 | +use PHPCSUtils\Utils\ObjectDeclarations; |
12 | 14 |
|
13 | 15 | /** |
14 | 16 | * Class WordPressVIPMinimum_Sniffs_Classes_DeclarationCompatibilitySniff |
@@ -201,15 +203,15 @@ public function __construct() { |
201 | 203 | */ |
202 | 204 | protected function processTokenWithinScope( File $phpcsFile, $stackPtr, $currScope ) { |
203 | 205 |
|
204 | | - $className = $phpcsFile->getDeclarationName( $currScope ); |
| 206 | + $className = ObjectDeclarations::getName( $phpcsFile, $currScope ); |
205 | 207 |
|
206 | 208 | if ( $className !== $this->currentClass ) { |
207 | 209 | $this->currentClass = $className; |
208 | 210 | } |
209 | 211 |
|
210 | | - $methodName = $phpcsFile->getDeclarationName( $stackPtr ); |
| 212 | + $methodName = FunctionDeclarations::getName( $phpcsFile, $stackPtr ); |
211 | 213 |
|
212 | | - $parentClassName = $phpcsFile->findExtendedClassName( $currScope ); |
| 214 | + $parentClassName = ObjectDeclarations::findExtendedClassName( $phpcsFile, $currScope ); |
213 | 215 | if ( $parentClassName === false ) { |
214 | 216 | // This class does not extend any other class. |
215 | 217 | return; |
@@ -242,7 +244,7 @@ protected function processTokenWithinScope( File $phpcsFile, $stackPtr, $currSco |
242 | 244 | return; |
243 | 245 | } |
244 | 246 |
|
245 | | - $signatureParams = $phpcsFile->getMethodParameters( $stackPtr ); |
| 247 | + $signatureParams = FunctionDeclarations::getParameters( $phpcsFile, $stackPtr ); |
246 | 248 |
|
247 | 249 | $parentSignature = $this->checkClasses[ $parentClassName ][ $methodName ]; |
248 | 250 |
|
|
0 commit comments