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
chore: handle unused variables (phpcs) #2902
chore: handle unused variables (phpcs) #2902
Conversation
Cherrypicked from wp-graphql#2830 Co-authored-by: Jason Bahl <jasonbahl@mac.com>
Cherrypicked from wp-graphql#2830 Co-authored-by: Jason Bahl <jasonbahl@mac.com>
Cherrypicked from wp-graphql#2830 Co-authored-by: Jason Bahl <jasonbahl@mac.com>
@@ -110,28 +110,28 @@ protected function init() { | |||
return ! empty( $this->data->public ) ? (bool) $this->data->public : true; | |||
}, | |||
'hierarchical' => function () { | |||
return ( true === $this->data->hierarchical ) ? true : false; | |||
return true === $this->data->hierarchical; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid too many return
statements within this method.
}, | ||
'showUi' => function () { | ||
return ( true === $this->data->show_ui ) ? true : false; | ||
return true === $this->data->show_ui; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid too many return
statements within this method.
}, | ||
'showInMenu' => function () { | ||
return ( true === $this->data->show_in_menu ) ? true : false; | ||
return true === $this->data->show_in_menu; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid too many return
statements within this method.
}, | ||
'showInNavMenus' => function () { | ||
return ( true === $this->data->show_in_nav_menus ) ? true : false; | ||
return true === $this->data->show_in_nav_menus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid too many return
statements within this method.
}, | ||
'showCloud' => function () { | ||
return ( true === $this->data->show_tagcloud ) ? true : false; | ||
return true === $this->data->show_tagcloud; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid too many return
statements within this method.
Code Climate has analyzed commit 3bf8f33 and detected 23 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
The merge-base changed after approval.
What does this implement/fix? Explain your changes.
This PR adds the
SlevomatCodingStandard.Variables.UnusedVariable
sniff to our PHPCS ruleset and remediates any unused variables in our codebase.The individual smells that required @jasonbahl 's expertise in #2830 were committed individually to expose those changes, especially 69854f6 which reads like a bugfix.
Based off of #2901 (and requires that to be merged first).
Does this close any currently open issues?
Cherrypicked from #2830
Any relevant logs, error output, GraphiQL screenshots, etc?
Any other comments?
…
Where has this been tested?
Operating System: …
WordPress Version: …