summaryrefslogtreecommitdiff
path: root/ext/pspell
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/pspell
parent2804ea612779b89d3c62d974eb35783dd31f7dee (diff)
downloadphp-git-27e83d0fb87c04b61441fb77e963dd4e14ad187e.tar.gz
Add union return types for function stubs
Diffstat (limited to 'ext/pspell')
-rw-r--r--ext/pspell/pspell.stub.php12
-rw-r--r--ext/pspell/pspell_arginfo.h8
2 files changed, 8 insertions, 12 deletions
diff --git a/ext/pspell/pspell.stub.php b/ext/pspell/pspell.stub.php
index 4d33d789f3..bf49093e85 100644
--- a/ext/pspell/pspell.stub.php
+++ b/ext/pspell/pspell.stub.php
@@ -1,18 +1,14 @@
<?php
-/** @return int|false */
-function pspell_new(string $language, string $spelling = UNKNOWN, string $jargon = UNKNOWN, string $encoding = UNKNOWN, int $mode = 0) {}
+function pspell_new(string $language, string $spelling = UNKNOWN, string $jargon = UNKNOWN, string $encoding = UNKNOWN, int $mode = 0): int|false {}
-/** @return int|false */
-function pspell_new_personal(string $personal, string $language, string $spelling = UNKNOWN, string $jargon = UNKNOWN, string $encoding = UNKNOWN, $mode = 0) {}
+function pspell_new_personal(string $personal, string $language, string $spelling = UNKNOWN, string $jargon = UNKNOWN, string $encoding = UNKNOWN, $mode = 0): int|false {}
-/** @return int|false */
-function pspell_new_config(int $config) {}
+function pspell_new_config(int $config): int|false {}
function pspell_check(int $pspell, string $word): bool {}
-/** @return array|false */
-function pspell_suggest(int $pspell, string $word) {}
+function pspell_suggest(int $pspell, string $word): array|false {}
function pspell_store_replacement(int $pspell, string $misspell, string $correct): bool {}
diff --git a/ext/pspell/pspell_arginfo.h b/ext/pspell/pspell_arginfo.h
index e406fb20a8..688aea3f6f 100644
--- a/ext/pspell/pspell_arginfo.h
+++ b/ext/pspell/pspell_arginfo.h
@@ -1,6 +1,6 @@
/* This is a generated file, edit the .stub.php file instead. */
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pspell_new, 0, 0, 1)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pspell_new, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, language, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, spelling, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, jargon, IS_STRING, 0)
@@ -8,7 +8,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_pspell_new, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pspell_new_personal, 0, 0, 2)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pspell_new_personal, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, personal, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, language, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, spelling, IS_STRING, 0)
@@ -17,7 +17,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_pspell_new_personal, 0, 0, 2)
ZEND_ARG_INFO(0, mode)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pspell_new_config, 0, 0, 1)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pspell_new_config, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, config, IS_LONG, 0)
ZEND_END_ARG_INFO()
@@ -26,7 +26,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pspell_check, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, word, IS_STRING, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pspell_suggest, 0, 0, 2)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pspell_suggest, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, pspell, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, word, IS_STRING, 0)
ZEND_END_ARG_INFO()