Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sniff for detecting single-use variables? #212

Open
lkraav opened this issue Oct 16, 2020 · 1 comment
Open

Sniff for detecting single-use variables? #212

lkraav opened this issue Oct 16, 2020 · 1 comment

Comments

@lkraav
Copy link

lkraav commented Oct 16, 2020

Trying to avoid this example BAD (due to refactoring, or simple human error):

$has_free_tag = has_tag( 'free' );

if ( $has_free_tag ) {
  ...
}

BETTER:

if ( has_tag( 'free' ) ) {
  ...
}
@sirbrillig
Copy link
Owner

That would be pretty cool! And not too hard, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants