Skip to content

Commit 451e8b5

Browse files
committed
CS/QA: remove redundant condition
Even though PR 2507 ensured we didn't automatically move onto PHPStan 2.0, the build is still failing as PHPStan 1.12.9 contained a change which causes a new error to show up. This commit fixes the newly flagged issue to allow builds to pass again. Ref: https://github.com/phpstan/phpstan/releases/tag/1.12.9
1 parent ffec7bf commit 451e8b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ private function validate_prefixes() {
12891289
*/
12901290
private function record_potential_prefix_metric( $stackPtr, $construct_name ) {
12911291
if ( preg_match( '`^([A-Z]*[a-z0-9]*+)`', ltrim( $construct_name, '\$_' ), $matches ) > 0
1292-
&& isset( $matches[1] ) && '' !== $matches[1]
1292+
&& '' !== $matches[1]
12931293
) {
12941294
$this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: potential prefixes - start of non-prefixed construct', strtolower( $matches[1] ) );
12951295
}

0 commit comments

Comments
 (0)