Skip to content

Commit 374691c

Browse files
committed
GlobalVariablesOverride: implement Sniff::is_class_object_call()
1 parent c98ecc2 commit 374691c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ protected function process_global_statement( $stackPtr, $in_function_scope ) {
310310
}
311311

312312
// Don't throw false positives for static class properties.
313-
$previous = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $ptr - 1 ), null, true, null, true );
314-
if ( false !== $previous && \T_DOUBLE_COLON === $this->tokens[ $previous ]['code'] ) {
313+
if ( $this->is_class_object_call( $ptr ) === true ) {
315314
continue;
316315
}
317316

0 commit comments

Comments
 (0)