Skip to content

Commit d53d10a

Browse files
committed
Address code review comments
1 parent 215e50d commit d53d10a

15 files changed

+27
-32
lines changed

ext/com_dotnet/com_extension.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
259259
COM_CONST(VARCMP_EQ);
260260
COM_CONST(VARCMP_GT);
261261
COM_CONST(VARCMP_NULL);
262+
COM_CONST(LOCALE_SYSTEM_DEFAULT);
262263

263264
COM_CONST(NORM_IGNORECASE);
264265
COM_CONST(NORM_IGNORENONSPACE);

ext/com_dotnet/com_extension.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function variant_not(mixed $left): variant {}
4242

4343
function variant_round(mixed $left, int $decimals): ?variant {}
4444

45-
function variant_cmp(mixed $left, mixed $right, ?int $lcid = null, int $flags = 0): int {}
45+
function variant_cmp(mixed $left, mixed $right, int $lcid = LOCALE_SYSTEM_DEFAULT, int $flags = 0): int {}
4646

4747
function variant_date_to_timestamp(variant $variant): ?int {}
4848

ext/com_dotnet/com_extension_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 4b5e5b0f9a64464dd05e873e10f2574666bb2aad */
2+
* Stub hash: caec4bba1103a07a86803ac0192782fef7d6680f */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_set, 0, 2, IS_VOID, 0)
55
ZEND_ARG_OBJ_INFO(0, variant, variant, 0)
@@ -55,7 +55,7 @@ ZEND_END_ARG_INFO()
5555
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_cmp, 0, 2, IS_LONG, 0)
5656
ZEND_ARG_TYPE_INFO(0, left, IS_MIXED, 0)
5757
ZEND_ARG_TYPE_INFO(0, right, IS_MIXED, 0)
58-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, lcid, IS_LONG, 1, "null")
58+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, lcid, IS_LONG, 0, "LOCALE_SYSTEM_DEFAULT")
5959
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
6060
ZEND_END_ARG_INFO()
6161

ext/com_dotnet/com_variant.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,7 @@ PHP_FUNCTION(variant_cmp)
862862
zval *zleft = NULL, *zright = NULL;
863863
php_com_dotnet_object *obj;
864864
int codepage = CP_ACP;
865-
zend_long lcid;
866-
zend_bool lcid_is_null = 1;
865+
zend_long lcid = LOCALE_SYSTEM_DEFAULT;
867866
zend_long flags = 0;
868867
/* it is safe to ignore the warning for this line; see the comments in com_handlers.c */
869868
STDAPI VarCmp(LPVARIANT pvarLeft, LPVARIANT pvarRight, LCID lcid, DWORD flags);
@@ -872,28 +871,28 @@ PHP_FUNCTION(variant_cmp)
872871
VariantInit(&right_val);
873872

874873
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
875-
ZEND_NUM_ARGS(), "OO|l!l", &zleft, php_com_variant_class_entry,
876-
&zright, php_com_variant_class_entry, &lcid, &lcid_is_null, &flags)) {
874+
ZEND_NUM_ARGS(), "OO|ll", &zleft, php_com_variant_class_entry,
875+
&zright, php_com_variant_class_entry, &lcid, &flags)) {
877876
obj = CDNO_FETCH(zleft);
878877
vleft = &obj->v;
879878
obj = CDNO_FETCH(zright);
880879
vright = &obj->v;
881880
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
882-
ZEND_NUM_ARGS(), "Oz!|l!l", &zleft, php_com_variant_class_entry,
883-
&zright, &lcid, &lcid_is_null, &flags)) {
881+
ZEND_NUM_ARGS(), "Oz!|ll", &zleft, php_com_variant_class_entry,
882+
&zright, &lcid, &flags)) {
884883
obj = CDNO_FETCH(zleft);
885884
vleft = &obj->v;
886885
vright = &right_val;
887886
php_com_variant_from_zval(vright, zright, codepage);
888887
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
889-
ZEND_NUM_ARGS(), "z!O|l!l", &zleft, &zright, php_com_variant_class_entry,
890-
&lcid, &lcid_is_null, &flags)) {
888+
ZEND_NUM_ARGS(), "z!O|ll", &zleft, &zright, php_com_variant_class_entry,
889+
&lcid, &flags)) {
891890
obj = CDNO_FETCH(zright);
892891
vright = &obj->v;
893892
vleft = &left_val;
894893
php_com_variant_from_zval(vleft, zleft, codepage);
895894
} else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(),
896-
"z!z!|l!l", &zleft, &zright, &lcid, &lcid_is_null, &flags)) {
895+
"z!z!|ll", &zleft, &zright, &lcid, &flags)) {
897896

898897
vleft = &left_val;
899898
php_com_variant_from_zval(vleft, zleft, codepage);
@@ -905,10 +904,6 @@ PHP_FUNCTION(variant_cmp)
905904
RETURN_THROWS();
906905
}
907906

908-
if (lcid_is_null) {
909-
lcid = LOCALE_SYSTEM_DEFAULT;
910-
}
911-
912907
ZVAL_LONG(return_value, VarCmp(vleft, vright, (LCID)lcid, (ULONG)flags));
913908

914909
VariantClear(&left_val);

ext/enchant/enchant.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function enchant_broker_set_ordering(EnchantBroker $broker, string $tag, string
3838

3939
function enchant_broker_describe(EnchantBroker $broker): array {}
4040

41-
/** @param array|null $suggestions */
41+
/** @param array $suggestions */
4242
function enchant_dict_quick_check(EnchantDictionary $dict, string $word, &$suggestions = null): bool {}
4343

4444
function enchant_dict_check(EnchantDictionary $dict, string $word): bool {}

ext/enchant/enchant_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: a7f2914ba1acd5fdde46120e9bc39db625ca2fdc */
2+
* Stub hash: 22c47f0b30f6952a42546c403fbd2e92836661fa */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_enchant_broker_init, 0, 0, EnchantBroker, MAY_BE_FALSE)
55
ZEND_END_ARG_INFO()

ext/hash/hash.stub.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ function hash_hmac_algos(): array {}
3030

3131
function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $raw_output = false): string {}
3232

33-
/**
34-
* @param string $known_string no type juggling is performed
35-
* @param string $user_string no type juggling is performed
36-
*/
3733
function hash_equals(string $known_string, string $user_string): bool {}
3834

3935
function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = '', string $salt = ''): string {}

ext/hash/hash_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 074ac4c7d8bf3fd068456fe0e7577de57dbe0487 */
2+
* Stub hash: 6da0ff3370cecc919fccf7c6791828a81b44156d */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)

ext/mbstring/mbstring.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function mb_convert_kana(string $str, string $option = "KV", ?string $encoding =
7575
* @param object|string|array $var
7676
* @param object|string|array $vars
7777
*/
78-
function mb_convert_variables(string $to, array|string $from, &$var, &...$vars): string|false {}
78+
function mb_convert_variables(string $to, array|string $from, mixed &$var, mixed &...$vars): string|false {}
7979

8080
function mb_encode_numericentity(string $string, array $convmap, ?string $encoding = null, bool $is_hex = false): string {}
8181

@@ -97,10 +97,10 @@ function mb_chr(int $cp, ?string $encoding = null): string|false {}
9797
#ifdef HAVE_MBREGEX
9898
function mb_regex_encoding(?string $encoding = null): string|bool {}
9999

100-
/** @param array|null $registers */
100+
/** @param array $registers */
101101
function mb_ereg(string $pattern, string $string, &$registers = null): int|false {}
102102

103-
/** @param array|null $registers */
103+
/** @param array $registers */
104104
function mb_eregi(string $pattern, string $string, &$registers = null): int|false {}
105105

106106
function mb_ereg_replace(string $pattern, string $replacement, string $string, ?string $option = null): string|false|null {}

ext/mbstring/mbstring_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 9ddd50c3c66d120260b4da57d45694201bd84b7d */
2+
* Stub hash: 615e21b594825ea0d71065f7816e77969d1aff30 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_language, 0, 0, MAY_BE_STRING|MAY_BE_BOOL)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, language, IS_STRING, 1, "null")
@@ -157,8 +157,8 @@ ZEND_END_ARG_INFO()
157157
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_convert_variables, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
158158
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
159159
ZEND_ARG_TYPE_MASK(0, from, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
160-
ZEND_ARG_INFO(1, var)
161-
ZEND_ARG_VARIADIC_INFO(1, vars)
160+
ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0)
161+
ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0)
162162
ZEND_END_ARG_INFO()
163163

164164
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_encode_numericentity, 0, 2, IS_STRING, 0)

ext/reflection/php_reflection.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3114,6 +3114,8 @@ ZEND_METHOD(ReflectionMethod, getClosure)
31143114
} else {
31153115
zend_create_fake_closure(return_value, mptr, mptr->common.scope, Z_OBJCE_P(obj), obj);
31163116
}
3117+
} else {
3118+
zend_argument_value_error(1, "cannot be null for non-static methods");
31173119
}
31183120
}
31193121
/* }}} */

ext/session/session.stub.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function session_cache_limiter(?string $cache_limiter = null): string|false {}
5656

5757
function session_cache_expire(?int $new_cache_expire = null): int|false {}
5858

59+
/** @param int|array $lifetime_or_options */
5960
function session_set_cookie_params($lifetime_or_options, string $path = UNKNOWN, string $domain = "", ?bool $secure = null, ?bool $httponly = null): bool {}
6061

6162
function session_start(array $options = []): bool {}

ext/session/session_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: db2b0189fa09eca771c4ce09a048124cb79f80e6 */
2+
* Stub hash: 9e4a4b1d719197772b283abfb1e515180d7b8bb0 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_session_name, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null")

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ function is_object(mixed $value): bool {}
13791379

13801380
function is_scalar(mixed $value): bool {}
13811381

1382-
/** @param string|null $callable_name */
1382+
/** @param string $callable_name */
13831383
function is_callable(mixed $value, bool $syntax_only = false, &$callable_name = null): bool {}
13841384

13851385
function is_iterable(mixed $value): bool {}

ext/standard/basic_functions_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: c7f2a71474b0289dbbe3a91642b5341e1f7ff3dc */
2+
* Stub hash: ced7e5bc2c202a0678a5616bc1ffd2ef0df66723 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
55
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)

0 commit comments

Comments
 (0)