Skip to content

Commit

Permalink
CS/QA: remove redundant condition
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jrfnl committed Nov 11, 2024
1 parent ffec7bf commit 4ce6dce
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ private function validate_prefixes() {
*/
private function record_potential_prefix_metric( $stackPtr, $construct_name ) {
if ( preg_match( '`^([A-Z]*[a-z0-9]*+)`', ltrim( $construct_name, '\$_' ), $matches ) > 0
&& isset( $matches[1] ) && '' !== $matches[1]
&& '' !== $matches[1]
) {
$this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: potential prefixes - start of non-prefixed construct', strtolower( $matches[1] ) );
}
Expand Down

0 comments on commit 4ce6dce

Please sign in to comment.