Repository navigation
SONARPHP-1972 Exempt underscore-prefixed unused local variables - #1853
Conversation
83a963e to
bd92efe
Compare
asya-vorobeva
left a comment
There was a problem hiding this comment.
Let's add sample cases that you mention in JIRA ticket to clarify actual usage. Provided sample doesn't illustrate purpose of change.
|
Code Review ✅ Approved🟡 Medium risk · Exempting all local variables prefixed $_ from the unused-variable check could let genuinely unused locals escape detection. Exempts local variables whose names start with Verification Rules 1/1 met Repos 3 inspected · PRs 2 inspectedFunctional validation No results Rules 1 passed 2 not applicable
Broader impact Repos 3 inspected PRs 2 inspectedCross-repo 3 repositories inspected 0 open impacts
Cross-PR 2 PRs inspected 0 open impactsAuto-approval Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|
@lijun-chen-sonarsource I let you guys merge the automatically created metadata update PR #1859 (review) once this is on master. I was about to merge, but Gitar made me aware that the underscore prefix exception is not yet on master. |
|
@karim-ouerghemmi-sonarsource Opss. Merged the rspec to hastily. Thanks for the heads up. I'll merge #1859 once this PR is merged (which should happen today). |




Stack created with GitHub Stacks CLI • Give Feedback 💬
Summary by Gitar
$_fromUnusedLocalVariableCheck$_variables in foreach, list, static, closure captures, and object assignments inUnusedLocalVariableCheck.phpThis will update automatically on new commits.