1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/readline: update return typehints from bool to true (#16545)

These always return true
This commit is contained in:
DanielEScherzer
2024-10-25 09:35:48 -07:00
committed by GitHub
parent 0b3684c48e
commit 922bd2fe52
3 changed files with 12 additions and 7 deletions

View File

@@ -100,6 +100,11 @@ PHP 8.5 UPGRADE NOTES
9. Other Changes to Extensions
========================================
- Readline:
. The return types of readline_add_history(), readline_clear_history(), and
readline_callback_handler_install() have been changed to true, rather
than bool.
========================================
10. New Global Constants
========================================

View File

@@ -13,9 +13,9 @@ function readline(?string $prompt = null): string|false {}
/** @param int|string|bool|null $value */
function readline_info(?string $var_name = null, $value = null): mixed {}
function readline_add_history(string $prompt): bool {}
function readline_add_history(string $prompt): true {}
function readline_clear_history(): bool {}
function readline_clear_history(): true {}
#ifdef HAVE_HISTORY_LIST
/**
@@ -33,7 +33,7 @@ function readline_completion_function(callable $callback): bool {}
#ifdef HAVE_RL_CALLBACK_READ_CHAR
function readline_callback_handler_install(string $prompt, callable $callback): bool {}
function readline_callback_handler_install(string $prompt, callable $callback): true {}
function readline_callback_read_char(): void {}

View File

@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 7b72b1af4217ac8647096cb7e2c239466949cbd2 */
* Stub hash: 7a314f75d9a89a9ea4d525515bb6bacdf7be6746 */
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")
@@ -10,11 +10,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_info, 0, 0, IS_MIXED, 0
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)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_add_history, 0, 1, IS_TRUE, 0)
ZEND_ARG_TYPE_INFO(0, prompt, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_clear_history, 0, 0, _IS_BOOL, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_clear_history, 0, 0, IS_TRUE, 0)
ZEND_END_ARG_INFO()
#if defined(HAVE_HISTORY_LIST)
@@ -33,7 +33,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_completion_function, 0,
ZEND_END_ARG_INFO()
#if defined(HAVE_RL_CALLBACK_READ_CHAR)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_callback_handler_install, 0, 2, _IS_BOOL, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_callback_handler_install, 0, 2, IS_TRUE, 0)
ZEND_ARG_TYPE_INFO(0, prompt, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
ZEND_END_ARG_INFO()