Update ext/pcntl parameter names

Closes GH-6278.
This commit is contained in:
Nikita Popov 2020-10-06 11:23:13 +02:00
parent 84e0ea6b43
commit 7a1dc180a6
5 changed files with 39 additions and 39 deletions

View File

@ -6,36 +6,36 @@ function pcntl_fork(): int {}
/**
* @param int $status
* @param array $rusage
* @param array $resource_usage
*/
function pcntl_waitpid(int $pid, &$status, int $options = 0, &$rusage = []): int {}
function pcntl_waitpid(int $process_id, &$status, int $flags = 0, &$resource_usage = []): int {}
/**
* @param int $status
* @param array $rusage
* @param array $resource_usage
*/
function pcntl_wait(&$status, int $options = 0, &$rusage = []): int {}
function pcntl_wait(&$status, int $flags = 0, &$resource_usage = []): int {}
/** @param callable|int $handler */
function pcntl_signal(int $signo, $handler, bool $restart_syscalls = true): bool {}
function pcntl_signal(int $signal, $handler, bool $restart_syscalls = true): bool {}
/** @return callable|int */
function pcntl_signal_get_handler(int $signo) {}
function pcntl_signal_get_handler(int $signal) {}
function pcntl_signal_dispatch(): bool {}
#ifdef HAVE_SIGPROCMASK
/** @param array $oldset */
function pcntl_sigprocmask(int $how, array $set, &$oldset = null): bool {}
/** @param array $old_signals */
function pcntl_sigprocmask(int $mode, array $signals, &$old_signals = null): bool {}
#endif
#ifdef HAVE_STRUCT_SIGINFO_T
#if defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
/** @param array $info */
function pcntl_sigwaitinfo(array $set, &$info = []): int|false {}
function pcntl_sigwaitinfo(array $signals, &$info = []): int|false {}
/** @param array $info */
function pcntl_sigtimedwait(array $set, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {}
function pcntl_sigtimedwait(array $signals, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {}
#endif
#endif
@ -55,7 +55,7 @@ function pcntl_wtermsig(int $status): int|false {}
function pcntl_wstopsig(int $status): int|false {}
function pcntl_exec(string $path, array $args = [], array $envs = []): bool {}
function pcntl_exec(string $path, array $args = [], array $env_vars = []): bool {}
function pcntl_alarm(int $seconds): int {}
@ -65,16 +65,16 @@ function pcntl_get_last_error(): int {}
function pcntl_errno(): int {}
#ifdef HAVE_GETPRIORITY
function pcntl_getpriority(?int $pid = null, int $process_identifier = PRIO_PROCESS): int|false {}
function pcntl_getpriority(?int $process_id = null, int $mode = PRIO_PROCESS): int|false {}
#endif
#ifdef HAVE_SETPRIORITY
function pcntl_setpriority(int $priority, ?int $pid = null, int $process_identifier = PRIO_PROCESS): bool{}
function pcntl_setpriority(int $priority, ?int $process_id = null, int $mode = PRIO_PROCESS): bool{}
#endif
function pcntl_strerror(int $errno): string {}
function pcntl_strerror(int $error_code): string {}
function pcntl_async_signals(?bool $on = null): bool {}
function pcntl_async_signals(?bool $enable = null): bool {}
#ifdef HAVE_UNSHARE
function pcntl_unshare(int $flags): bool {}

View File

@ -1,30 +1,30 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 306208d94ba3bf6f8112f868a332e99717bc07fa */
* Stub hash: 8742901e9b4fe5ee595a1e7c492474723f95d253 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_fork, 0, 0, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_waitpid, 0, 2, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, pid, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, process_id, IS_LONG, 0)
ZEND_ARG_INFO(1, status)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, rusage, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, resource_usage, "[]")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_wait, 0, 1, IS_LONG, 0)
ZEND_ARG_INFO(1, status)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, rusage, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, resource_usage, "[]")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_signal, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, signo, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, signal, IS_LONG, 0)
ZEND_ARG_INFO(0, handler)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, restart_syscalls, _IS_BOOL, 0, "true")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_pcntl_signal_get_handler, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, signo, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, signal, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_signal_dispatch, 0, 0, _IS_BOOL, 0)
@ -32,22 +32,22 @@ ZEND_END_ARG_INFO()
#if defined(HAVE_SIGPROCMASK)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_sigprocmask, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, how, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, set, IS_ARRAY, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, oldset, "null")
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, signals, IS_ARRAY, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, old_signals, "null")
ZEND_END_ARG_INFO()
#endif
#if defined(HAVE_STRUCT_SIGINFO_T) && defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_sigwaitinfo, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, set, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, signals, IS_ARRAY, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, info, "[]")
ZEND_END_ARG_INFO()
#endif
#if defined(HAVE_STRUCT_SIGINFO_T) && defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_sigtimedwait, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, set, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, signals, IS_ARRAY, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, info, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, seconds, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nanoseconds, IS_LONG, 0, "0")
@ -79,7 +79,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_exec, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, args, IS_ARRAY, 0, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, envs, IS_ARRAY, 0, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, env_vars, IS_ARRAY, 0, "[]")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_alarm, 0, 1, IS_LONG, 0)
@ -92,25 +92,25 @@ ZEND_END_ARG_INFO()
#if defined(HAVE_GETPRIORITY)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_getpriority, 0, 0, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pid, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, process_identifier, IS_LONG, 0, "PRIO_PROCESS")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, process_id, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PRIO_PROCESS")
ZEND_END_ARG_INFO()
#endif
#if defined(HAVE_SETPRIORITY)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_setpriority, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, priority, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pid, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, process_identifier, IS_LONG, 0, "PRIO_PROCESS")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, process_id, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PRIO_PROCESS")
ZEND_END_ARG_INFO()
#endif
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_strerror, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, errno, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, error_code, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_async_signals, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, on, _IS_BOOL, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 1, "null")
ZEND_END_ARG_INFO()
#if defined(HAVE_UNSHARE)

View File

@ -20,4 +20,4 @@ try {
?>
--EXPECT--
pcntl_getpriority(): Argument #2 ($process_identifier) must be one of PRIO_PGRP, PRIO_USER, or PRIO_PROCESS
pcntl_getpriority(): Argument #2 ($mode) must be one of PRIO_PGRP, PRIO_USER, or PRIO_PROCESS

View File

@ -20,4 +20,4 @@ try {
?>
--EXPECT--
pcntl_setpriority(): Argument #3 ($process_identifier) must be one of PRIO_PGRP, PRIO_USER, or PRIO_PROCESS
pcntl_setpriority(): Argument #3 ($mode) must be one of PRIO_PGRP, PRIO_USER, or PRIO_PROCESS

View File

@ -45,7 +45,7 @@ echo "ok\n";
signal dispatched
got signal from %r\d+|nobody%r
bool(true)
pcntl_signal(): Argument #1 ($signo) must be greater than or equal to 1
pcntl_signal(): Argument #1 ($signo) must be greater than or equal to 1
pcntl_signal(): Argument #1 ($signal) must be greater than or equal to 1
pcntl_signal(): Argument #1 ($signal) must be greater than or equal to 1
pcntl_signal(): Argument #2 ($handler) must be of type callable|int, string given
ok