Skip to content

Commit 4e8f340

Browse files
authored
Merge pull request #2363 from WordPress/feature/cs-closures-should-be-static
2 parents d199361 + 8c81cc6 commit 4e8f340

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function process_token( $stackPtr ) {
327327
if ( $stripped_content !== $content ) {
328328
$vars_without_wpdb = array_filter(
329329
TextStrings::getEmbeds( $content ),
330-
function ( $symbol ) {
330+
static function ( $symbol ) {
331331
return preg_match( '`^\{?\$\{?wpdb\??->`', $symbol ) !== 1;
332332
}
333333
);

WordPress/Sniffs/DB/PreparedSQLSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function process_token( $stackPtr ) {
176176

177177
$bad_variables = array_filter(
178178
TextStrings::getEmbeds( $this->tokens[ $this->i ]['content'] ),
179-
function ( $symbol ) {
179+
static function ( $symbol ) {
180180
return preg_match( '`^\{?\$\{?wpdb\??->`', $symbol ) !== 1;
181181
}
182182
);

0 commit comments

Comments
 (0)