Skip to content

Commit f124466

Browse files
jrfnlGaryJones
andcommitted
AbstractVariableRestrictionsSniff: use WPCS ContextHelper::is_in_isset_or_empty()
Co-authored-by: Gary Jones <[email protected]>
1 parent 4198a6d commit f124466

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

WordPressVIPMinimum/Sniffs/AbstractVariableRestrictionsSniff.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use PHPCSUtils\Utils\GetTokensAsString;
1313
use PHPCSUtils\Utils\MessageHelper;
14+
use WordPressCS\WordPress\Helpers\ContextHelper;
1415

1516
/**
1617
* Restricts usage of some variables.
@@ -144,7 +145,7 @@ public function process_token( $stackPtr ) {
144145
}
145146
}
146147

147-
if ( $this->is_in_isset_or_empty( $stackPtr ) === true ) {
148+
if ( ContextHelper::is_in_isset_or_empty( $this->phpcsFile, $stackPtr ) === true ) {
148149
// Checking whether a variable exists is not the same as using it.
149150
return;
150151
}

0 commit comments

Comments
 (0)