Skip to content

Update \SNMP class signatures #3927

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

Open
wants to merge 1 commit into
base: 2.1.x
Choose a base branch
from

Conversation

miken32
Copy link

@miken32 miken32 commented Apr 8, 2025

Per the documentation for SNMP::get():

If objectId is a string, then SNMP::get() will return SNMP object as string. If objectId is a array, all requested SNMP objects will be returned as associative array of the SNMP object ids and their values.

I updated the return types for SNMP::get() and SNMP::getnext() to reflect this. I also updated the arguments to use their canonical (camel case) names and corrected a mistake in the ordering of two arguments to SNMP::walk().

One change I wasn't sure about: can arguments can accept complex expressions like return types do? The documentation for SNMP::set() says:

If objectId is string, both type and value must be string too. If objectId is array, value must be equal-sized array containing corresponding values, type may be either string (it's value will be used for all objectId-value pairs) or equal-sized array with per-OID value.

So I adjusted the argument types to reflect this logic but am not sure if this is ok or not.

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

Successfully merging this pull request may close these issues.

1 participant