summaryrefslogtreecommitdiff
path: root/ext/pcntl
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2019-11-08 23:29:12 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2019-11-11 14:54:55 +0100
commit27e83d0fb87c04b61441fb77e963dd4e14ad187e (patch)
tree1b35b21c48c54f353e643d29dd2306d8e1ba084a /ext/pcntl
parent2804ea612779b89d3c62d974eb35783dd31f7dee (diff)
downloadphp-git-27e83d0fb87c04b61441fb77e963dd4e14ad187e.tar.gz
Add union return types for function stubs
Diffstat (limited to 'ext/pcntl')
-rw-r--r--ext/pcntl/pcntl.stub.php19
-rw-r--r--ext/pcntl/pcntl_arginfo.h8
2 files changed, 10 insertions, 17 deletions
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()