Skip to content

Commit 4b5b077

Browse files
committed
AbstractVariableRestrictions: use PHPCSUtils for retrieving tokens as string
1 parent 4fdb103 commit 4b5b077

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
@@ -9,6 +9,7 @@
99

1010
namespace WordPressVIPMinimum\Sniffs;
1111

12+
use PHPCSUtils\Utils\GetTokensAsString;
1213
use PHPCSUtils\Utils\MessageHelper;
1314

1415
/**
@@ -179,7 +180,7 @@ public function process_token( $stackPtr ) {
179180

180181
if ( isset( $token['bracket_closer'] ) ) {
181182
$owner = $this->phpcsFile->findPrevious( \T_VARIABLE, $stackPtr );
182-
$inside = $this->phpcsFile->getTokensAsString( $stackPtr, $token['bracket_closer'] - $stackPtr + 1 );
183+
$inside = GetTokensAsString::normal( $this->phpcsFile, $stackPtr, $token['bracket_closer'] );
183184
$var = implode( '', [ $this->tokens[ $owner ]['content'], $inside ] );
184185
}
185186
}

0 commit comments

Comments
 (0)