Skip to content

Commit 5e8bdaf

Browse files
committed
Merge branch 'PHP-8.0'
* Fix the return types in ext/snmp (#7068)
2 parents 2389ac2 + 15ec740 commit 5e8bdaf

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

ext/snmp/snmp.stub.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
/** @generate-class-entries */
44

5-
function snmpget(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {}
5+
function snmpget(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
66

7-
function snmpgetnext(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {}
7+
function snmpgetnext(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
88

9-
function snmpwalk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
9+
function snmpwalk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
1010

11-
function snmprealwalk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
11+
function snmprealwalk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
1212

1313
/** @alias snmprealwalk */
14-
function snmpwalkoid(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
14+
function snmpwalkoid(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
1515

16-
function snmpset(string $hostname, string $community, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): array|bool {}
16+
function snmpset(string $hostname, string $community, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): bool {}
1717

1818
function snmp_get_quick_print(): bool {}
1919

@@ -26,46 +26,46 @@ function snmp_set_oid_output_format(int $format): bool {}
2626
/** @alias snmp_set_oid_output_format */
2727
function snmp_set_oid_numeric_print(int $format): bool {}
2828

29-
function snmp2_get(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {}
29+
function snmp2_get(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
3030

31-
function snmp2_getnext(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {}
31+
function snmp2_getnext(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
3232

33-
function snmp2_walk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
33+
function snmp2_walk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
3434

35-
function snmp2_real_walk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
35+
function snmp2_real_walk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
3636

37-
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 {}
37+
function snmp2_set(string $hostname, string $community, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): bool {}
3838

3939
function snmp3_get(
4040
string $hostname, string $security_name, string $security_level,
4141
string $auth_protocol, string $auth_passphrase,
4242
string $privacy_protocol, string $privacy_passphrase,
43-
array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {}
43+
array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
4444

4545
function snmp3_getnext(
4646
string $hostname, string $security_name, string $security_level,
4747
string $auth_protocol, string $auth_passphrase,
4848
string $privacy_protocol, string $privacy_passphrase,
49-
array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {}
49+
array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
5050

5151
function snmp3_walk(
5252
string $hostname, string $security_name, string $security_level,
5353
string $auth_protocol, string $auth_passphrase,
5454
string $privacy_protocol, string $privacy_passphrase,
55-
array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
55+
array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
5656

5757
function snmp3_real_walk(
5858
string $hostname, string $security_name, string $security_level,
5959
string $auth_protocol, string $auth_passphrase,
6060
string $privacy_protocol, string $privacy_passphrase,
61-
array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
61+
array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
6262

6363
function snmp3_set(
6464
string $hostname, string $security_name, string $security_level,
6565
string $auth_protocol, string $auth_passphrase,
6666
string $privacy_protocol, string $privacy_passphrase,
6767
array|string $object_id, array|string $type, array|string $value,
68-
int $timeout = -1, int $retries = -1): array|bool {}
68+
int $timeout = -1, int $retries = -1): bool {}
6969

7070
function snmp_set_valueretrieval(int $method): bool {}
7171

@@ -96,16 +96,16 @@ public function setSecurity(
9696
string $privacyProtocol = "", string $privacyPassphrase = "",
9797
string $contextName = "", string $contextEngineId = "") {}
9898

99-
/** @return array|bool */
99+
/** @return mixed */
100100
public function get(array|string $objectId, bool $preserveKeys = false) {}
101101

102-
/** @return array|bool */
102+
/** @return mixed */
103103
public function getnext(array|string $objectId) {}
104104

105-
/** @return array|bool */
105+
/** @return array|false */
106106
public function walk(array|string $objectId, bool $suffixAsKey = false, int $maxRepetitions = -1, int $nonRepeaters = -1) {}
107107

108-
/** @return array|bool */
108+
/** @return bool */
109109
public function set(array|string $objectId, array|string $type, array|string $value) {}
110110

111111
/** @return int */

ext/snmp/snmp_arginfo.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 5258c5796aca15e369dd72c0a8ed4dc1df31ce9d */
2+
* Stub hash: 87b5f1c8b3a350442ab1d8c85580e203388b0ef7 */
33

4-
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_snmpget, 0, 3, stdClass, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL)
4+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmpget, 0, 3, IS_MIXED, 0)
55
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
66
ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0)
77
ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
@@ -11,7 +11,7 @@ ZEND_END_ARG_INFO()
1111

1212
#define arginfo_snmpgetnext arginfo_snmpget
1313

14-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmpwalk, 0, 3, MAY_BE_ARRAY|MAY_BE_BOOL)
14+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmpwalk, 0, 3, MAY_BE_ARRAY|MAY_BE_FALSE)
1515
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
1616
ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0)
1717
ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
@@ -23,7 +23,7 @@ ZEND_END_ARG_INFO()
2323

2424
#define arginfo_snmpwalkoid arginfo_snmpwalk
2525

26-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmpset, 0, 5, MAY_BE_ARRAY|MAY_BE_BOOL)
26+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmpset, 0, 5, _IS_BOOL, 0)
2727
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
2828
ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0)
2929
ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
@@ -58,7 +58,7 @@ ZEND_END_ARG_INFO()
5858

5959
#define arginfo_snmp2_set arginfo_snmpset
6060

61-
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_snmp3_get, 0, 8, stdClass, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL)
61+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp3_get, 0, 8, IS_MIXED, 0)
6262
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
6363
ZEND_ARG_TYPE_INFO(0, security_name, IS_STRING, 0)
6464
ZEND_ARG_TYPE_INFO(0, security_level, IS_STRING, 0)
@@ -73,7 +73,7 @@ ZEND_END_ARG_INFO()
7373

7474
#define arginfo_snmp3_getnext arginfo_snmp3_get
7575

76-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmp3_walk, 0, 8, MAY_BE_ARRAY|MAY_BE_BOOL)
76+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmp3_walk, 0, 8, MAY_BE_ARRAY|MAY_BE_FALSE)
7777
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
7878
ZEND_ARG_TYPE_INFO(0, security_name, IS_STRING, 0)
7979
ZEND_ARG_TYPE_INFO(0, security_level, IS_STRING, 0)
@@ -88,7 +88,7 @@ ZEND_END_ARG_INFO()
8888

8989
#define arginfo_snmp3_real_walk arginfo_snmp3_walk
9090

91-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmp3_set, 0, 10, MAY_BE_ARRAY|MAY_BE_BOOL)
91+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp3_set, 0, 10, _IS_BOOL, 0)
9292
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
9393
ZEND_ARG_TYPE_INFO(0, security_name, IS_STRING, 0)
9494
ZEND_ARG_TYPE_INFO(0, security_level, IS_STRING, 0)

0 commit comments

Comments
 (0)