Skip to content

Commit 06053e9

Browse files
committed
Remove unnecessary curl version guards in stubs
We have bumped the libcurl requirement to 7.29.0 in PHP 8.1, but the function declarations in the stubs were still conditional on the curl version. Drop them to make it more obvious that these functions are always available.
1 parent a06d015 commit 06053e9

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

ext/curl/curl.stub.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@ function curl_errno(CurlHandle $handle): int {}
2525

2626
function curl_error(CurlHandle $handle): string {}
2727

28-
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
2928
function curl_escape(CurlHandle $handle, string $string): string|false {}
3029

3130
function curl_unescape(CurlHandle $handle, string $string): string|false {}
3231

3332
function curl_multi_setopt(CurlMultiHandle $multi_handle, int $option, mixed $value): bool {}
3433

35-
#endif
36-
3734
function curl_exec(CurlHandle $handle): string|bool {}
3835

3936
function curl_file_create(string $filename, ?string $mime_type = null, ?string $posted_filename = null): CURLFile {}
@@ -64,9 +61,7 @@ function curl_multi_select(CurlMultiHandle $multi_handle, float $timeout = 1.0):
6461

6562
function curl_multi_strerror(int $error_code): ?string {}
6663

67-
#if LIBCURL_VERSION_NUM >= 0x071200 /* 7.18.0 */
6864
function curl_pause(CurlHandle $handle, int $flags): int {}
69-
#endif
7065

7166
function curl_reset(CurlHandle $handle): void {}
7267

ext/curl/curl_arginfo.h

Lines changed: 1 addition & 25 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: b0f2f56d0a38656637190456e5ebd87bf052ee14 */
2+
* Stub hash: 0b574385806ffec3ad96c1b584778cb53bd42535 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_close, 0, 1, IS_VOID, 0)
55
ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0)
@@ -17,24 +17,18 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_error, 0, 1, IS_STRING, 0)
1717
ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0)
1818
ZEND_END_ARG_INFO()
1919

20-
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
2120
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_curl_escape, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
2221
ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0)
2322
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
2423
ZEND_END_ARG_INFO()
25-
#endif
2624

27-
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
2825
#define arginfo_curl_unescape arginfo_curl_escape
29-
#endif
3026

31-
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
3227
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_multi_setopt, 0, 3, _IS_BOOL, 0)
3328
ZEND_ARG_OBJ_INFO(0, multi_handle, CurlMultiHandle, 0)
3429
ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0)
3530
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
3631
ZEND_END_ARG_INFO()
37-
#endif
3832

3933
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_curl_exec, 0, 1, MAY_BE_STRING|MAY_BE_BOOL)
4034
ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0)
@@ -96,12 +90,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_multi_strerror, 0, 1, IS_ST
9690
ZEND_ARG_TYPE_INFO(0, error_code, IS_LONG, 0)
9791
ZEND_END_ARG_INFO()
9892

99-
#if LIBCURL_VERSION_NUM >= 0x071200 /* 7.18.0 */
10093
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_pause, 0, 2, IS_LONG, 0)
10194
ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0)
10295
ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
10396
ZEND_END_ARG_INFO()
104-
#endif
10597

10698
#define arginfo_curl_reset arginfo_curl_close
10799

@@ -145,15 +137,9 @@ ZEND_FUNCTION(curl_close);
145137
ZEND_FUNCTION(curl_copy_handle);
146138
ZEND_FUNCTION(curl_errno);
147139
ZEND_FUNCTION(curl_error);
148-
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
149140
ZEND_FUNCTION(curl_escape);
150-
#endif
151-
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
152141
ZEND_FUNCTION(curl_unescape);
153-
#endif
154-
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
155142
ZEND_FUNCTION(curl_multi_setopt);
156-
#endif
157143
ZEND_FUNCTION(curl_exec);
158144
ZEND_FUNCTION(curl_file_create);
159145
ZEND_FUNCTION(curl_getinfo);
@@ -168,9 +154,7 @@ ZEND_FUNCTION(curl_multi_init);
168154
ZEND_FUNCTION(curl_multi_remove_handle);
169155
ZEND_FUNCTION(curl_multi_select);
170156
ZEND_FUNCTION(curl_multi_strerror);
171-
#if LIBCURL_VERSION_NUM >= 0x071200 /* 7.18.0 */
172157
ZEND_FUNCTION(curl_pause);
173-
#endif
174158
ZEND_FUNCTION(curl_reset);
175159
ZEND_FUNCTION(curl_setopt_array);
176160
ZEND_FUNCTION(curl_setopt);
@@ -188,15 +172,9 @@ static const zend_function_entry ext_functions[] = {
188172
ZEND_FE(curl_copy_handle, arginfo_curl_copy_handle)
189173
ZEND_FE(curl_errno, arginfo_curl_errno)
190174
ZEND_FE(curl_error, arginfo_curl_error)
191-
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
192175
ZEND_FE(curl_escape, arginfo_curl_escape)
193-
#endif
194-
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
195176
ZEND_FE(curl_unescape, arginfo_curl_unescape)
196-
#endif
197-
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
198177
ZEND_FE(curl_multi_setopt, arginfo_curl_multi_setopt)
199-
#endif
200178
ZEND_FE(curl_exec, arginfo_curl_exec)
201179
ZEND_FE(curl_file_create, arginfo_curl_file_create)
202180
ZEND_FE(curl_getinfo, arginfo_curl_getinfo)
@@ -211,9 +189,7 @@ static const zend_function_entry ext_functions[] = {
211189
ZEND_FE(curl_multi_remove_handle, arginfo_curl_multi_remove_handle)
212190
ZEND_FE(curl_multi_select, arginfo_curl_multi_select)
213191
ZEND_FE(curl_multi_strerror, arginfo_curl_multi_strerror)
214-
#if LIBCURL_VERSION_NUM >= 0x071200 /* 7.18.0 */
215192
ZEND_FE(curl_pause, arginfo_curl_pause)
216-
#endif
217193
ZEND_FE(curl_reset, arginfo_curl_reset)
218194
ZEND_FE(curl_setopt_array, arginfo_curl_setopt_array)
219195
ZEND_FE(curl_setopt, arginfo_curl_setopt)

0 commit comments

Comments
 (0)