From 66c65def7665d74b9efbd8066a0ab83ba21fbf27 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 8 Oct 2020 11:08:03 +0200 Subject: [PATCH 1/2] Update ext/snmp parameter names --- ext/snmp/snmp.stub.php | 72 +++++++++++++++++++++++++++-------------- ext/snmp/snmp_arginfo.h | 62 +++++++++++++++++------------------ 2 files changed, 78 insertions(+), 56 deletions(-) diff --git a/ext/snmp/snmp.stub.php b/ext/snmp/snmp.stub.php index e0cdab8f04470..c025e365cdf4d 100644 --- a/ext/snmp/snmp.stub.php +++ b/ext/snmp/snmp.stub.php @@ -2,49 +2,70 @@ /** @generate-function-entries */ -function snmpget(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} +function snmpget(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} -function snmpgetnext(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} +function snmpgetnext(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} -function snmpwalk(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} +function snmpwalk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} -function snmprealwalk(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} +function snmprealwalk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} /** @alias snmprealwalk */ -function snmpwalkoid(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} +function snmpwalkoid(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} -function snmpset(string $host, string $community, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): array|bool {} +function snmpset(string $hostname, string $community, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): array|bool {} function snmp_get_quick_print(): bool {} -function snmp_set_quick_print(bool $quick_print): bool {} +function snmp_set_quick_print(bool $enable): bool {} -function snmp_set_enum_print(bool $enum_print): bool {} +function snmp_set_enum_print(bool $enable): bool {} function snmp_set_oid_output_format(int $oid_format): bool {} /** @alias snmp_set_oid_output_format */ function snmp_set_oid_numeric_print(int $oid_format): bool {} -function snmp2_get(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} +function snmp2_get(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} -function snmp2_getnext(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} +function snmp2_getnext(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} -function snmp2_walk(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} +function snmp2_walk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} -function snmp2_real_walk(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} +function snmp2_real_walk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} -function snmp2_set(string $host, string $community, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): array|bool {} +function snmp2_set(string $hostname, string $community, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): array|bool {} -function snmp3_get(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} +function snmp3_get( + string $hostname, string $sec_name, string $sec_level, + string $auth_protocol, string $auth_passphrase, + string $privacy_protocol, string $privacy_passphrase, + array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} -function snmp3_getnext(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} +function snmp3_getnext( + string $hostname, string $sec_name, string $sec_level, + string $auth_protocol, string $auth_passphrase, + string $privacy_protocol, string $privacy_passphrase, + array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} -function snmp3_walk(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} +function snmp3_walk( + string $hostname, string $sec_name, string $sec_level, + string $auth_protocol, string $auth_passphrase, + string $privacy_protocol, string $privacy_passphrase, + array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} -function snmp3_real_walk(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} +function snmp3_real_walk( + string $hostname, string $sec_name, string $sec_level, + string $auth_protocol, string $auth_passphrase, + string $privacy_protocol, string $privacy_passphrase, + array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} -function snmp3_set(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): array|bool {} +function snmp3_set( + string $hostname, string $sec_name, string $sec_level, + string $auth_protocol, string $auth_passphrase, + string $privacy_protocol, string $privacy_passphrase, + array|string $object_id, array|string $type, array|string $value, + int $timeout = -1, int $retries = -1): array|bool {} function snmp_set_valueretrieval(int $method): bool {} @@ -54,25 +75,28 @@ function snmp_read_mib(string $filename): bool {} class SNMP { - public function __construct(int $version, string $host, string $community, int $timeout = -1, int $retries = -1) {} + public function __construct(int $version, string $hostname, string $community, int $timeout = -1, int $retries = -1) {} /** @return bool */ public function close() {} /** @return bool */ - public function setSecurity(string $sec_level, string $auth_protocol = "", string $auth_passphrase = "", string $priv_protocol = "", string $priv_passphrase = "", string $contextName = "", string $contextEngineID = "") {} + public function setSecurity( + string $secLevel, string $authProtocol = "", string $authPassphrase = "", + string $privacyProtocol = "", string $privacyPassphrase = "", + string $contextName = "", string $contextEngineId = "") {} /** @return array|bool */ - public function get(array|string $object_id, bool $use_orignames = false) {} + public function get(array|string $objectId, bool $preserveKeys = false) {} /** @return array|bool */ - public function getnext(array|string $object_id) {} + public function getnext(array|string $objectId) {} /** @return array|bool */ - public function walk(array|string $object_id, bool $suffix_keys = false, int $max_repetitions = -1, int $non_repeaters = -1) {} + public function walk(array|string $objectId, bool $suffixAsKey = false, int $maxRepetitions = -1, int $nonRepeaters = -1) {} /** @return array|bool */ - public function set(array|string $object_id, array|string $type, array|string $value) {} + public function set(array|string $objectId, array|string $type, array|string $value) {} /** @return int */ public function getErrno() {} diff --git a/ext/snmp/snmp_arginfo.h b/ext/snmp/snmp_arginfo.h index b145870f37155..eddfeb3e343b5 100644 --- a/ext/snmp/snmp_arginfo.h +++ b/ext/snmp/snmp_arginfo.h @@ -1,8 +1,8 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4b1adaf7afe143328f1b05c7039fb3d974b29545 */ + * Stub hash: ccd1540981df14d5ce3e6440a353978be8cc8dcc */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_snmpget, 0, 3, stdClass, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1") @@ -12,7 +12,7 @@ ZEND_END_ARG_INFO() #define arginfo_snmpgetnext arginfo_snmpget ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmpwalk, 0, 3, MAY_BE_ARRAY|MAY_BE_BOOL) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1") @@ -24,7 +24,7 @@ ZEND_END_ARG_INFO() #define arginfo_snmpwalkoid arginfo_snmpwalk ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmpset, 0, 5, MAY_BE_ARRAY|MAY_BE_BOOL) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_MASK(0, type, MAY_BE_ARRAY|MAY_BE_STRING, NULL) @@ -37,12 +37,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_get_quick_print, 0, 0, _IS_ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_quick_print, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, quick_print, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_enum_print, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, enum_print, _IS_BOOL, 0) -ZEND_END_ARG_INFO() +#define arginfo_snmp_set_enum_print arginfo_snmp_set_quick_print ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_oid_output_format, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, oid_format, IS_LONG, 0) @@ -61,13 +59,13 @@ ZEND_END_ARG_INFO() #define arginfo_snmp2_set arginfo_snmpset ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_snmp3_get, 0, 8, stdClass, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, sec_name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_protocol, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, priv_protocol, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, priv_passphrase, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, privacy_protocol, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, privacy_passphrase, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retries, IS_LONG, 0, "-1") @@ -76,13 +74,13 @@ ZEND_END_ARG_INFO() #define arginfo_snmp3_getnext arginfo_snmp3_get ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmp3_walk, 0, 8, MAY_BE_ARRAY|MAY_BE_BOOL) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, sec_name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_protocol, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, priv_protocol, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, priv_passphrase, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, privacy_protocol, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, privacy_passphrase, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retries, IS_LONG, 0, "-1") @@ -91,13 +89,13 @@ ZEND_END_ARG_INFO() #define arginfo_snmp3_real_walk arginfo_snmp3_walk ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmp3_set, 0, 10, MAY_BE_ARRAY|MAY_BE_BOOL) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, sec_name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_protocol, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, priv_protocol, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, priv_passphrase, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, privacy_protocol, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, privacy_passphrase, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_MASK(0, type, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_MASK(0, value, MAY_BE_ARRAY|MAY_BE_STRING, NULL) @@ -118,7 +116,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP___construct, 0, 0, 3) ZEND_ARG_TYPE_INFO(0, version, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retries, IS_LONG, 0, "-1") @@ -128,33 +126,33 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_close, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_setSecurity, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auth_protocol, IS_STRING, 0, "\"\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auth_passphrase, IS_STRING, 0, "\"\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, priv_protocol, IS_STRING, 0, "\"\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, priv_passphrase, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO(0, secLevel, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authProtocol, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authPassphrase, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, privacyProtocol, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, privacyPassphrase, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, contextName, IS_STRING, 0, "\"\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, contextEngineID, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, contextEngineId, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_get, 0, 0, 1) - ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_orignames, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_MASK(0, objectId, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, preserveKeys, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_getnext, 0, 0, 1) - ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_MASK(0, objectId, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_walk, 0, 0, 1) - ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, suffix_keys, _IS_BOOL, 0, "false") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_repetitions, IS_LONG, 0, "-1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, non_repeaters, IS_LONG, 0, "-1") + ZEND_ARG_TYPE_MASK(0, objectId, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, suffixAsKey, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxRepetitions, IS_LONG, 0, "-1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nonRepeaters, IS_LONG, 0, "-1") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_set, 0, 0, 3) - ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_MASK(0, objectId, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_MASK(0, type, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_MASK(0, value, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() From 55d934c0a2c3ea63164555689fca00245738826a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 8 Oct 2020 16:39:49 +0200 Subject: [PATCH 2/2] Review --- ext/snmp/snmp.stub.php | 16 ++++++++-------- ext/snmp/snmp_arginfo.h | 18 +++++++++--------- ext/snmp/tests/snmp_set_oid_output_format.phpt | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ext/snmp/snmp.stub.php b/ext/snmp/snmp.stub.php index c025e365cdf4d..25ad96d033175 100644 --- a/ext/snmp/snmp.stub.php +++ b/ext/snmp/snmp.stub.php @@ -21,10 +21,10 @@ function snmp_set_quick_print(bool $enable): bool {} function snmp_set_enum_print(bool $enable): bool {} -function snmp_set_oid_output_format(int $oid_format): bool {} +function snmp_set_oid_output_format(int $format): bool {} /** @alias snmp_set_oid_output_format */ -function snmp_set_oid_numeric_print(int $oid_format): bool {} +function snmp_set_oid_numeric_print(int $format): bool {} function snmp2_get(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} @@ -37,31 +37,31 @@ function snmp2_real_walk(string $hostname, string $community, array|string $obje function snmp2_set(string $hostname, string $community, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): array|bool {} function snmp3_get( - string $hostname, string $sec_name, string $sec_level, + string $hostname, string $security_name, string $security_level, string $auth_protocol, string $auth_passphrase, string $privacy_protocol, string $privacy_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} function snmp3_getnext( - string $hostname, string $sec_name, string $sec_level, + string $hostname, string $security_name, string $security_level, string $auth_protocol, string $auth_passphrase, string $privacy_protocol, string $privacy_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {} function snmp3_walk( - string $hostname, string $sec_name, string $sec_level, + string $hostname, string $security_name, string $security_level, string $auth_protocol, string $auth_passphrase, string $privacy_protocol, string $privacy_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} function snmp3_real_walk( - string $hostname, string $sec_name, string $sec_level, + string $hostname, string $security_name, string $security_level, string $auth_protocol, string $auth_passphrase, string $privacy_protocol, string $privacy_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {} function snmp3_set( - string $hostname, string $sec_name, string $sec_level, + string $hostname, string $security_name, string $security_level, string $auth_protocol, string $auth_passphrase, string $privacy_protocol, string $privacy_passphrase, array|string $object_id, array|string $type, array|string $value, @@ -82,7 +82,7 @@ public function close() {} /** @return bool */ public function setSecurity( - string $secLevel, string $authProtocol = "", string $authPassphrase = "", + string $securityLevel, string $authProtocol = "", string $authPassphrase = "", string $privacyProtocol = "", string $privacyPassphrase = "", string $contextName = "", string $contextEngineId = "") {} diff --git a/ext/snmp/snmp_arginfo.h b/ext/snmp/snmp_arginfo.h index eddfeb3e343b5..7a91113c50a1f 100644 --- a/ext/snmp/snmp_arginfo.h +++ b/ext/snmp/snmp_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: ccd1540981df14d5ce3e6440a353978be8cc8dcc */ + * Stub hash: 68d61381ba27923bb68d6d9c6e5d5e8ff296cc90 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_snmpget, 0, 3, stdClass, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) @@ -43,7 +43,7 @@ ZEND_END_ARG_INFO() #define arginfo_snmp_set_enum_print arginfo_snmp_set_quick_print ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_oid_output_format, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, oid_format, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, format, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_snmp_set_oid_numeric_print arginfo_snmp_set_oid_output_format @@ -60,8 +60,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_snmp3_get, 0, 8, stdClass, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, sec_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, security_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, security_level, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_protocol, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, privacy_protocol, IS_STRING, 0) @@ -75,8 +75,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmp3_walk, 0, 8, MAY_BE_ARRAY|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, sec_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, security_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, security_level, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_protocol, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, privacy_protocol, IS_STRING, 0) @@ -90,8 +90,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmp3_set, 0, 10, MAY_BE_ARRAY|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, sec_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, security_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, security_level, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_protocol, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, privacy_protocol, IS_STRING, 0) @@ -126,7 +126,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_close, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_setSecurity, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, secLevel, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, securityLevel, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authProtocol, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authPassphrase, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, privacyProtocol, IS_STRING, 0, "\"\"") diff --git a/ext/snmp/tests/snmp_set_oid_output_format.phpt b/ext/snmp/tests/snmp_set_oid_output_format.phpt index 9cc28b3c6df10..dddf81914aeca 100644 --- a/ext/snmp/tests/snmp_set_oid_output_format.phpt +++ b/ext/snmp/tests/snmp_set_oid_output_format.phpt @@ -24,7 +24,7 @@ var_dump(snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC)); ?> --EXPECT-- Checking error handling -snmp_set_oid_output_format(): Argument #1 ($oid_format) must be an SNMP_OID_OUTPUT_* constant +snmp_set_oid_output_format(): Argument #1 ($format) must be an SNMP_OID_OUTPUT_* constant Checking working bool(true) bool(true)