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/shmop/shmop.stub.php | 26 +++++++------------------- ext/shmop/shmop_arginfo.h | 4 ++-- 2 files changed, 9 insertions(+), 21 deletions(-) (limited to 'ext/shmop') diff --git a/ext/shmop/shmop.stub.php b/ext/shmop/shmop.stub.php index 11a65fc728..8ee2eeba9d 100644 --- a/ext/shmop/shmop.stub.php +++ b/ext/shmop/shmop.stub.php @@ -3,29 +3,17 @@ /** @return resource|false */ function shmop_open(int $key, string $flags, int $mode, int $size) {} -/** - * @param resource $shmid - * @return string|false - */ -function shmop_read($shmid, int $start, int $count) {} +/** @param resource $shmid */ +function shmop_read($shmid, int $start, int $count): string|false {} -/** - * @param resource $shmid - */ +/** @param resource $shmid */ function shmop_close($shmid): void {} -/** - * @param resource $shmid - */ +/** @param resource $shmid */ function shmop_size($shmid): int {} -/** - * @param resource $shmid - * @return int|false - */ -function shmop_write($shmid, string $data, int $offset) {} +/** @param resource $shmid */ +function shmop_write($shmid, string $data, int $offset): int|false {} -/** - * @param resource $shmid - */ +/** @param resource $shmid */ function shmop_delete($shmid): bool {} diff --git a/ext/shmop/shmop_arginfo.h b/ext/shmop/shmop_arginfo.h index c91b4ace12..49afa595db 100644 --- a/ext/shmop/shmop_arginfo.h +++ b/ext/shmop/shmop_arginfo.h @@ -7,7 +7,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_open, 0, 0, 4) ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_read, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_shmop_read, 0, 3, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_INFO(0, shmid) ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0) @@ -21,7 +21,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_shmop_size, 0, 1, IS_LONG, 0) ZEND_ARG_INFO(0, shmid) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_shmop_write, 0, 0, 3) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_shmop_write, 0, 3, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_INFO(0, shmid) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) -- cgit v1.2.1