Skip to content

Review parameter names in ext/readline #6240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/readline/readline.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
function readline(?string $prompt = null): string|false {}

/**
* @param int|string|bool|null $newvalue
* @param int|string|bool|null $value
* @return array|int|string|bool|null
*/
function readline_info(?string $varname = null, $newvalue = null): mixed {}
function readline_info(?string $var_name = null, $value = null): mixed {}

function readline_add_history(string $prompt): bool {}

Expand All @@ -22,7 +22,7 @@ function readline_read_history(?string $filename = null): bool {}

function readline_write_history(?string $filename = null): bool {}

function readline_completion_function(callable $funcname): bool {}
function readline_completion_function(callable $callback): bool {}


#if HAVE_RL_CALLBACK_READ_CHAR
Expand Down
8 changes: 4 additions & 4 deletions ext/readline/readline_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: c7d13f6960171cab30984837379db25b32f38c36 */
* Stub hash: 226b138a99e3e32aea90cbb5c44446ac7c16db71 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_readline, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, prompt, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_info, 0, 0, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, varname, IS_STRING, 1, "null")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, newvalue, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, var_name, IS_STRING, 1, "null")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, value, "null")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_add_history, 0, 1, _IS_BOOL, 0)
Expand All @@ -29,7 +29,7 @@ ZEND_END_ARG_INFO()
#define arginfo_readline_write_history arginfo_readline_read_history

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_completion_function, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, funcname, IS_CALLABLE, 0)
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
ZEND_END_ARG_INFO()

#if HAVE_RL_CALLBACK_READ_CHAR
Expand Down
4 changes: 2 additions & 2 deletions ext/readline/tests/readline_completion_function_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ foreach ($data as $callback) {
--EXPECT--
bool(true)
bool(true)
readline_completion_function(): Argument #1 ($funcname) must be a valid callback, no array or string given
readline_completion_function(): Argument #1 ($funcname) must be a valid callback, no array or string given
readline_completion_function(): Argument #1 ($callback) must be a valid callback, no array or string given
readline_completion_function(): Argument #1 ($callback) must be a valid callback, no array or string given