From 27e83d0fb87c04b61441fb77e963dd4e14ad187e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Fri, 8 Nov 2019 23:29:12 +0100 Subject: Add union return types for function stubs --- ext/pcntl/pcntl.stub.php | 19 ++++++------------- ext/pcntl/pcntl_arginfo.h | 8 ++++---- 2 files changed, 10 insertions(+), 17 deletions(-) (limited to 'ext/pcntl') diff --git a/ext/pcntl/pcntl.stub.php b/ext/pcntl/pcntl.stub.php index 1bb1f69709..7ca872663a 100644 --- a/ext/pcntl/pcntl.stub.php +++ b/ext/pcntl/pcntl.stub.php @@ -22,11 +22,9 @@ function pcntl_sigprocmask(int $how, array $set, &$oldset = null): bool {} #ifdef HAVE_STRUCT_SIGINFO_T #if HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT -/** @return int|false */ -function pcntl_sigwaitinfo(array $set, &$info = []) {} +function pcntl_sigwaitinfo(array $set, &$info = []): int|false {} -/** @return int|false */ -function pcntl_sigtimedwait(array $set, &$info = [], int $seconds = 0, int $nanoseconds = 0) {} +function pcntl_sigtimedwait(array $set, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {} #endif #endif @@ -40,16 +38,12 @@ function pcntl_wifcontinued(int $status): bool {} function pcntl_wifsignaled(int $status): bool {} -/** @return int|false */ -function pcntl_wifexitstatus(int $status) {} +function pcntl_wifexitstatus(int $status): int|false {} -/** @return int|false */ -function pcntl_wtermsig(int $status) {} +function pcntl_wtermsig(int $status): int|false {} -/** @return int|false */ -function pcntl_wstopsig(int $status) {} +function pcntl_wstopsig(int $status): int|false {} -/** @return false */ function pcntl_exec(string $path, array $args = [], array $envs = []): bool {} function pcntl_alarm(int $seconds): int {} @@ -57,8 +51,7 @@ function pcntl_alarm(int $seconds): int {} function pcntl_get_last_error(): int {} #ifdef HAVE_GETPRIORITY -/** @return int|false */ -function pcntl_getpriority(int $pid = UNKNOWN, int $process_identifier = PRIO_PROCESS) {} +function pcntl_getpriority(int $pid = UNKNOWN, int $process_identifier = PRIO_PROCESS): int|false {} #endif #ifdef HAVE_SETPRIORITY diff --git a/ext/pcntl/pcntl_arginfo.h b/ext/pcntl/pcntl_arginfo.h index 21a1c6aabd..7fc37ab4ec 100644 --- a/ext/pcntl/pcntl_arginfo.h +++ b/ext/pcntl/pcntl_arginfo.h @@ -38,14 +38,14 @@ ZEND_END_ARG_INFO() #endif #if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT -ZEND_BEGIN_ARG_INFO_EX(arginfo_pcntl_sigwaitinfo, 0, 0, 1) +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_INFO(1, info) ZEND_END_ARG_INFO() #endif #if defined(HAVE_STRUCT_SIGINFO_T) && HAVE_SIGWAITINFO && HAVE_SIGTIMEDWAIT -ZEND_BEGIN_ARG_INFO_EX(arginfo_pcntl_sigtimedwait, 0, 0, 1) +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_INFO(1, info) ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) @@ -67,7 +67,7 @@ ZEND_END_ARG_INFO() #define arginfo_pcntl_wifsignaled arginfo_pcntl_wifexited -ZEND_BEGIN_ARG_INFO_EX(arginfo_pcntl_wifexitstatus, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_wifexitstatus, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, status, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -88,7 +88,7 @@ ZEND_END_ARG_INFO() #define arginfo_pcntl_get_last_error arginfo_pcntl_fork #if defined(HAVE_GETPRIORITY) -ZEND_BEGIN_ARG_INFO_EX(arginfo_pcntl_getpriority, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_getpriority, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, pid, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, process_identifier, IS_LONG, 0) ZEND_END_ARG_INFO() -- cgit v1.2.1