Skip to content

Commit

Permalink
WPDBTrait::is_wpdb_method_call(): use PHPCSUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Dec 17, 2022
1 parent dd420c9 commit b7a7fd6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion WordPress/Helpers/WPDBTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace WordPressCS\WordPress\Helpers;

use PHP_CodeSniffer\Files\File;
use PHPCSUtils\BackCompat\BCFile;

/**
* Helper utilities for sniffs which examine WPDB method calls.
Expand Down Expand Up @@ -102,7 +103,7 @@ protected function is_wpdb_method_call( File $phpcsFile, $stackPtr, $target_meth
}

// Find the end of the first parameter.
$end = $phpcsFile->findEndOfStatement( $opening_paren + 1 );
$end = BCFile::findEndOfStatement( $phpcsFile, $opening_paren + 1 );

if ( \T_COMMA !== $tokens[ $end ]['code'] ) {
++$end;
Expand Down

0 comments on commit b7a7fd6

Please sign in to comment.