Skip to content

Commit

Permalink
ext/readline: update return typehints from bool to true (php#16545)
Browse files Browse the repository at this point in the history
These always return true
  • Loading branch information
DanielEScherzer authored Oct 25, 2024
1 parent 0b3684c commit 922bd2f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -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
========================================
Expand Down
6 changes: 3 additions & 3 deletions ext/readline/readline.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
/**
Expand All @@ -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 {}

Expand Down
8 changes: 4 additions & 4 deletions ext/readline/readline_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 922bd2f

Please sign in to comment.