Files
kulakpos_web/vendor/thecodingmachine/safe/generated/8.4/readline.php

97 lines
1.8 KiB
PHP
Raw Normal View History

2026-03-30 14:54:57 +07:00
<?php
namespace Safe;
use Safe\Exceptions\ReadlineException;
/**
2026-04-18 20:32:18 +07:00
* @param string $prompt
* @return bool
2026-03-30 14:54:57 +07:00
*
*/
function readline_add_history(string $prompt): bool
{
error_clear_last();
$safeResult = \readline_add_history($prompt);
return $safeResult;
}
/**
2026-04-18 20:32:18 +07:00
* @param string $prompt
* @param callable $callback
* @return bool
2026-03-30 14:54:57 +07:00
*
*/
function readline_callback_handler_install(string $prompt, callable $callback): bool
{
error_clear_last();
$safeResult = \readline_callback_handler_install($prompt, $callback);
return $safeResult;
}
/**
2026-04-18 20:32:18 +07:00
* @return bool
2026-03-30 14:54:57 +07:00
*
*/
function readline_clear_history(): bool
{
error_clear_last();
$safeResult = \readline_clear_history();
return $safeResult;
}
/**
2026-04-18 20:32:18 +07:00
* @param callable $callback
2026-03-30 14:54:57 +07:00
* @throws ReadlineException
*
*/
function readline_completion_function(callable $callback): void
{
error_clear_last();
$safeResult = \readline_completion_function($callback);
if ($safeResult === false) {
throw ReadlineException::createFromPhpError();
}
}
/**
2026-04-18 20:32:18 +07:00
* @param null|string $filename
2026-03-30 14:54:57 +07:00
* @throws ReadlineException
*
*/
function readline_read_history(?string $filename = null): void
{
error_clear_last();
if ($filename !== null) {
$safeResult = \readline_read_history($filename);
} else {
$safeResult = \readline_read_history();
}
if ($safeResult === false) {
throw ReadlineException::createFromPhpError();
}
}
/**
2026-04-18 20:32:18 +07:00
* @param null|string $filename
2026-03-30 14:54:57 +07:00
* @throws ReadlineException
*
*/
function readline_write_history(?string $filename = null): void
{
error_clear_last();
if ($filename !== null) {
$safeResult = \readline_write_history($filename);
} else {
$safeResult = \readline_write_history();
}
if ($safeResult === false) {
throw ReadlineException::createFromPhpError();
}
}