Skip to content

Commit 4ce6dce

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](https://github.com/WordPress/WordPress-Coding-Standards/actions/runs/11775908547/job/32797254994) to allow builds to pass again. Ref: https://github.com/phpstan/phpstan/releases/tag/1.12.9
1 parent ffec7bf commit 4ce6dce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php

+1-1
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)