fix(snmpagent): drop redundant snmp_priv_passphrase check in authNoPriv branch#7188
Merged
TheWitness merged 1 commit intoMay 31, 2026
Conversation
…iv branch The elseif is only reached when the preceding (password && priv) is false, so with password true the passphrase is already known empty; the extra !snmp_priv_passphrase term is dead. PHPStan level 6 flags it as always-true. Removing it clears the develop PHPStan gate without changing behavior. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Simplifies SNMPv3 security-level selection logic in snmpagent_notification() by removing a redundant condition.
Changes:
- Simplified the
elseifbranch that assignsauthNoPrivto rely solely onsnmp_passwordafter theauthPrivcase is handled.
TheWitness
approved these changes
May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PHPStan level 6 (the
PHP x Testjob insyntax.yml) currently fails ondevelopHEAD:In both SNMPv3 trap blocks the
elseifis reached only when the precedingif (snmp_password && snmp_priv_passphrase)is false. Withsnmp_passwordtrue at theelseif,snmp_priv_passphraseis necessarily empty, so&& !snmp_priv_passphraseis dead. Dropping it is behavior-identical and clears the gate. Per the repo's PHPStan policy this fixes the underlying cause rather than baselining.Verified locally:
composer run-script phpstanreports[OK] No errors. Unblocks the develop PHP test job for open develop PRs.