From: Máté Kocsis Date: Thu, 17 Sep 2020 18:15:01 +0000 (+0200) Subject: Improve parameter names in ext/curl X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6024a90543b52da81d710ce6e4738d057955a36;p=php Improve parameter names in ext/curl Closes GH-6155 --- diff --git a/ext/curl/curl.stub.php b/ext/curl/curl.stub.php index c2951b1c6a..2eba460d6c 100644 --- a/ext/curl/curl.stub.php +++ b/ext/curl/curl.stub.php @@ -33,7 +33,7 @@ function curl_multi_setopt(CurlMultiHandle $multi_handle, int $option, mixed $va function curl_exec(CurlHandle $handle): string|bool {} -function curl_file_create(string $filename, ?string $mimetype = null, ?string $postname = null): CURLFile {} +function curl_file_create(string $filename, ?string $mime_type = null, ?string $posted_filename = null): CURLFile {} function curl_getinfo(CurlHandle $handle, ?int $option = null): mixed {} @@ -50,8 +50,8 @@ function curl_multi_exec(CurlMultiHandle $multi_handle, &$still_running): int {} function curl_multi_getcontent(CurlHandle $multi_handle): ?string {} -/** @param int|null $msgs_in_queue */ -function curl_multi_info_read(CurlMultiHandle $multi_handle, &$msgs_in_queue = null): array|false {} +/** @param int $queued_messages */ +function curl_multi_info_read(CurlMultiHandle $multi_handle, &$queued_messages = null): array|false {} function curl_multi_init(): CurlMultiHandle {} @@ -59,10 +59,10 @@ function curl_multi_remove_handle(CurlMultiHandle $multi_handle, CurlHandle $han function curl_multi_select(CurlMultiHandle $multi_handle, float $timeout = 1.0): int {} -function curl_multi_strerror(int $error_number): ?string {} +function curl_multi_strerror(int $error_code): ?string {} #if LIBCURL_VERSION_NUM >= 0x071200 /* 7.18.0 */ -function curl_pause(CurlHandle $handle, int $bitmask): int {} +function curl_pause(CurlHandle $handle, int $flags): int {} #endif function curl_reset(CurlHandle $handle): void {} @@ -79,8 +79,8 @@ function curl_share_init(): CurlShareHandle {} function curl_share_setopt(CurlShareHandle $share_handle, int $option, mixed $value): bool {} -function curl_share_strerror(int $error_number): ?string {} +function curl_share_strerror(int $error_code): ?string {} -function curl_strerror(int $error_number): ?string {} +function curl_strerror(int $error_code): ?string {} function curl_version(): array|false {} diff --git a/ext/curl/curl_arginfo.h b/ext/curl/curl_arginfo.h index 30f2e839a8..e213f9d318 100644 --- a/ext/curl/curl_arginfo.h +++ b/ext/curl/curl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: ca65615cacfe914f3511007fd393169ffededf34 */ + * Stub hash: afeae538b49eb43a661e5b491da79c17d10c6bfe */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_close, 0, 1, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0) @@ -42,8 +42,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_curl_file_create, 0, 1, CURLFile, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mimetype, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, postname, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mime_type, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, posted_filename, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_getinfo, 0, 1, IS_MIXED, 0) @@ -79,7 +79,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_curl_multi_info_read, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, multi_handle, CurlMultiHandle, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, msgs_in_queue, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, queued_messages, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_curl_multi_init, 0, 0, CurlMultiHandle, 0) @@ -93,13 +93,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_multi_select, 0, 1, IS_LONG ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_multi_strerror, 0, 1, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, error_number, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, error_code, IS_LONG, 0) ZEND_END_ARG_INFO() #if LIBCURL_VERSION_NUM >= 0x071200 /* 7.18.0 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_pause, 0, 2, IS_LONG, 0) ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0) - ZEND_ARG_TYPE_INFO(0, bitmask, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_END_ARG_INFO() #endif diff --git a/ext/curl/curl_file.stub.php b/ext/curl/curl_file.stub.php index 14d775d293..28a218c698 100644 --- a/ext/curl/curl_file.stub.php +++ b/ext/curl/curl_file.stub.php @@ -4,7 +4,7 @@ class CURLFile { - public function __construct(string $filename, ?string $mimetype = null, ?string $postname = null) {} + public function __construct(string $filename, ?string $mime_type = null, ?string $posted_filename = null) {} /** @return string */ public function getFilename() {} @@ -16,8 +16,8 @@ class CURLFile public function getPostFilename() {} /** @return void */ - public function setMimeType(string $mime) {} + public function setMimeType(string $mime_type) {} /** @return void */ - public function setPostFilename(string $postname) {} + public function setPostFilename(string $posted_filename) {} } diff --git a/ext/curl/curl_file_arginfo.h b/ext/curl/curl_file_arginfo.h index 526bd322f5..c745d597da 100644 --- a/ext/curl/curl_file_arginfo.h +++ b/ext/curl/curl_file_arginfo.h @@ -1,10 +1,10 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 2dbca0eed1723e959b2a56d6035239b189f52495 */ + * Stub hash: a81720edab23748f6dce30306f5a5ffc9634da5d */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mimetype, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, postname, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mime_type, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, posted_filename, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile_getFilename, 0, 0, 0) @@ -15,11 +15,11 @@ ZEND_END_ARG_INFO() #define arginfo_class_CURLFile_getPostFilename arginfo_class_CURLFile_getFilename ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile_setMimeType, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, mime, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mime_type, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile_setPostFilename, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, postname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, posted_filename, IS_STRING, 0) ZEND_END_ARG_INFO()