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

I18nTextDomainFixer: remove unnecessary variable initialization #2513

Conversation

rodrigoprimo
Copy link
Collaborator

Initializing the variable here is unnecessary as its value is immediately overridden in the if/else below.
Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@jrfnl jrfnl added this to the 3.2.0 milestone Nov 30, 2024
@dingo-d
Copy link
Member

dingo-d commented Dec 2, 2024

We could probably run 'inspect code' function from PhpStorm and quickly see similar unused variables in the codebase (and potential other fixes from the suggestion)

image

@dingo-d dingo-d merged commit 9f9726a into WordPress:develop Dec 2, 2024
39 checks passed
@rodrigoprimo rodrigoprimo deleted the remove-unnecessary-variable-initialization branch December 2, 2024 14:54
@rodrigoprimo
Copy link
Collaborator Author

We could probably run 'inspect code' function from PhpStorm and quickly see similar unused variables in the codebase (and potential other fixes from the suggestion)

That is a good idea, @dingo-d. If you are not planning to do it yourself, I can try that. Just let me know what you prefer.

@dingo-d
Copy link
Member

dingo-d commented Dec 2, 2024

I mean if you're already working on it you can take over, but it's not a problem for me to do as well 😄

@jrfnl
Copy link
Member

jrfnl commented Dec 2, 2024

Sounds like a plan gentlemen ;-) Please do check history though when doing this as some of these things may have been put in place to satisfy a higher PHPStan level than we're currently running at and a commit message may hint at that, if that's the case.

@rodrigoprimo
Copy link
Collaborator Author

Just documenting here that I created the PR to remove unused variables detected by PHPStorm: #2514

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

Successfully merging this pull request may close these issues.

3 participants