summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-09-16 21:19:36 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-09-16 21:19:36 +0200
commitc76910cd967f498065f50f17dcaad941792e8430 (patch)
treeadc49e15035601cf65dc2211f43cb4094eead12d
parent0286decdb4acdfedd6365ed46f06e43cfdbf3673 (diff)
downloadphp-git-c76910cd967f498065f50f17dcaad941792e8430.tar.gz
Display types in stubs more uniformly
In preparation for generating method signatures for the manual. This change gets rid of bogus false|null return types, a few unnecessary trailing backslashes, and settles on using ? when possible for nullable types.
-rw-r--r--ext/dom/php_dom.stub.php5
-rw-r--r--ext/dom/php_dom_arginfo.h2
-rw-r--r--ext/imap/php_imap.stub.php12
-rw-r--r--ext/imap/php_imap_arginfo.h2
-rw-r--r--ext/intl/php_intl.stub.php2
-rw-r--r--ext/intl/php_intl_arginfo.h2
-rw-r--r--ext/oci8/oci8.stub.php4
-rw-r--r--ext/oci8/oci8_arginfo.h2
-rw-r--r--ext/pdo/pdo_stmt.stub.php2
-rw-r--r--ext/pdo/pdo_stmt_arginfo.h2
-rw-r--r--ext/sockets/sockets.stub.php2
-rw-r--r--ext/sockets/sockets_arginfo.h2
-rwxr-xr-xext/spl/spl_directory.stub.php2
-rw-r--r--ext/spl/spl_directory_arginfo.h2
-rwxr-xr-xext/standard/basic_functions.stub.php2
-rw-r--r--ext/standard/basic_functions_arginfo.h2
-rw-r--r--ext/zip/php_zip.stub.php8
-rw-r--r--ext/zip/php_zip_arginfo.h2
18 files changed, 28 insertions, 29 deletions
diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php
index 8ed6723250..5f15f99e17 100644
--- a/ext/dom/php_dom.stub.php
+++ b/ext/dom/php_dom.stub.php
@@ -56,8 +56,7 @@ class DOMNode
/** @return int */
public function getLineNo() {}
- /** @return string|null
- */
+ /** @return string|null */
public function getNodePath() {}
/** @return bool */
@@ -211,7 +210,7 @@ class DOMElement implements DOMParentNode, DOMChildNode
/** @return DOMAttr|bool */
public function setAttribute(string $qualifiedName, string $value) {}
- /** @return null|false */
+ /** @return bool|null */
public function setAttributeNS(?string $namespace, string $qualifiedName, string $value) {}
/** @return DOMAttr|null|false */
diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h
index 7da82ba710..d5da40e463 100644
--- a/ext/dom/php_dom_arginfo.h
+++ b/ext/dom/php_dom_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 6d25769eb3f8686042dccc55d8d8bd5e3852676f */
+ * Stub hash: 8ac9356f9b19b84e98d335bc9d091b022a0f549d */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 1)
ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0)
diff --git a/ext/imap/php_imap.stub.php b/ext/imap/php_imap.stub.php
index fb83dc6c54..d707af161c 100644
--- a/ext/imap/php_imap.stub.php
+++ b/ext/imap/php_imap.stub.php
@@ -35,7 +35,7 @@ function imap_headerinfo($stream_id, int $msg_no, int $from_length = 0, int $sub
*/
function imap_header($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN): stdClass|false {}
-function imap_rfc822_parse_headers(string $headers, string $default_host = 'UNKNOWN'): \stdClass {}
+function imap_rfc822_parse_headers(string $headers, string $default_host = 'UNKNOWN'): stdClass {}
function imap_rfc822_write_address(string $mailbox, string $host, string $personal): string|false {}
@@ -52,7 +52,7 @@ function imap_fetchtext($stream_id, int $msg_no, int $options = 0): string|false
/**
* @param resource $stream_id
- * @return \stdClass|false
+ * @return stdClass|false
*/
function imap_bodystruct($stream_id, int $msg_no, string $section) {}
@@ -166,12 +166,12 @@ function imap_utf8(string $mime_encoded_text): string {}
/**
* @param resource $stream_id
- * @return \stdClass|false
+ * @return stdClass|false
*/
function imap_status($stream_id, string $mailbox, int $options) {}
/** @param resource $stream_id */
-function imap_mailboxmsginfo($stream_id): \stdClass {}
+function imap_mailboxmsginfo($stream_id): stdClass {}
/** @param resource $stream_id */
function imap_setflag_full($stream_id, string $sequence, string $flag, int $options = 0): bool {}
@@ -222,7 +222,7 @@ function imap_errors(): array|false {}
function imap_last_error(): string|false {}
/** @param resource $stream_id */
-function imap_search($stream_id, string $criteria, int $options = \SE_FREE, string $charset = ''): array|false {}
+function imap_search($stream_id, string $criteria, int $options = SE_FREE, string $charset = ''): array|false {}
function imap_utf7_decode(string $buf): string|false {}
@@ -237,7 +237,7 @@ function imap_mutf7_to_utf8(string $in): string|false {}
function imap_mime_header_decode(string $str): array|false {}
/** @param resource $stream_id */
-function imap_thread($stream_id, int $options = \SE_FREE): array|false {}
+function imap_thread($stream_id, int $options = SE_FREE): array|false {}
function imap_timeout(int $timeout_type, int $timeout = -1): int|bool {}
diff --git a/ext/imap/php_imap_arginfo.h b/ext/imap/php_imap_arginfo.h
index fd679f9953..013ef9096c 100644
--- a/ext/imap/php_imap_arginfo.h
+++ b/ext/imap/php_imap_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 449bab2357a8a83cbe4f630a87776ebb5e0d65f6 */
+ * Stub hash: 2c859e2e8d8de83dc517a245b5b34a6dd74e5dab */
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_open, 0, 0, 3)
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
diff --git a/ext/intl/php_intl.stub.php b/ext/intl/php_intl.stub.php
index f2a1af1c2e..67bd27be92 100644
--- a/ext/intl/php_intl.stub.php
+++ b/ext/intl/php_intl.stub.php
@@ -5,7 +5,7 @@
/* calendar */
/** @param IntlTimeZone|DateTimeZone|string|null $timeZone */
-function intlcal_create_instance($timeZone = null, ?string $locale = null): IntlCalendar|null {}
+function intlcal_create_instance($timeZone = null, ?string $locale = null): ?IntlCalendar {}
function intlcal_get_keyword_values_for_locale(string $key, string $locale, bool $commonlyUsed): IntlIterator|false {}
diff --git a/ext/intl/php_intl_arginfo.h b/ext/intl/php_intl_arginfo.h
index 32f098d0bb..1b1c0ea84d 100644
--- a/ext/intl/php_intl_arginfo.h
+++ b/ext/intl/php_intl_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 324b7ae3eaab4777117c1c6963bc841088e6b998 */
+ * Stub hash: 943baf02eee2f720a45106e379534b3d4adc3072 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timeZone, "null")
diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php
index 917225f562..58eb984f94 100644
--- a/ext/oci8/oci8.stub.php
+++ b/ext/oci8/oci8.stub.php
@@ -320,14 +320,14 @@ function ocifreecursor($statement_resource): bool {}
/**
* @param resource $connection_resource
*/
-function oci_close($connection_resource): bool|null {}
+function oci_close($connection_resource): ?bool {}
/**
* @param resource $connection_resource
* @alias oci_close
* @deprecated
*/
-function ocilogoff($connection_resource): bool|null {}
+function ocilogoff($connection_resource): ?bool {}
/**
* @return resource|false
diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h
index 0bcc18f06a..b385554bdf 100644
--- a/ext/oci8/oci8_arginfo.h
+++ b/ext/oci8/oci8_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 6cdc7c967ce80c39eaef1c860ba8f8aa2cb3c979 */
+ * Stub hash: 9c680329bc6159aae027df94230c6d2342021271 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_define_by_name, 0, 3, _IS_BOOL, 0)
ZEND_ARG_INFO(0, statement_resource)
diff --git a/ext/pdo/pdo_stmt.stub.php b/ext/pdo/pdo_stmt.stub.php
index d0141ceb45..b280f73ffd 100644
--- a/ext/pdo/pdo_stmt.stub.php
+++ b/ext/pdo/pdo_stmt.stub.php
@@ -19,7 +19,7 @@ class PDOStatement implements IteratorAggregate
/** @return int|false */
public function columnCount() {}
- /** @return false|null */
+ /** @return bool|null */
public function debugDumpParams() {}
/** @return string|false|null */
diff --git a/ext/pdo/pdo_stmt_arginfo.h b/ext/pdo/pdo_stmt_arginfo.h
index c05606c6fa..116449ad3a 100644
--- a/ext/pdo/pdo_stmt_arginfo.h
+++ b/ext/pdo/pdo_stmt_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 18f2af62bebcbbbf0e298f781860c251cfa07930 */
+ * Stub hash: a35e66ccff5e569f07ae8372e661e005943dfbc7 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2)
ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL)
diff --git a/ext/sockets/sockets.stub.php b/ext/sockets/sockets.stub.php
index 547374fe97..8acab114e5 100644
--- a/ext/sockets/sockets.stub.php
+++ b/ext/sockets/sockets.stub.php
@@ -78,7 +78,7 @@ function socket_setopt(Socket $socket, int $level, int $optname, $optval): bool
#ifdef HAVE_SOCKETPAIR
/** @param array $fd */
-function socket_create_pair(int $domain, int $type, int $protocol, &$fd): bool|null {}
+function socket_create_pair(int $domain, int $type, int $protocol, &$fd): ?bool {}
#endif
#ifdef HAVE_SHUTDOWN
diff --git a/ext/sockets/sockets_arginfo.h b/ext/sockets/sockets_arginfo.h
index e7f4c04799..0923918a94 100644
--- a/ext/sockets/sockets_arginfo.h
+++ b/ext/sockets/sockets_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: f2d1b412bf2e07c3e607aa6ebad25b19d882b98e */
+ * Stub hash: f35790f5f703b37c45230e97e8f0ee736727b4bd */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(1, read_fds, IS_ARRAY, 1)
diff --git a/ext/spl/spl_directory.stub.php b/ext/spl/spl_directory.stub.php
index 4691378ca9..0e942a2e12 100755
--- a/ext/spl/spl_directory.stub.php
+++ b/ext/spl/spl_directory.stub.php
@@ -211,7 +211,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIt
/** @return int|false */
public function fputcsv(array $fields, string $delimiter = ',', string $enclosure = '"', string $escape = "\\") {}
- /** @return null|false */
+ /** @return bool|null */
public function setCsvControl(string $delimiter = ",", string $enclosure = "\"", string $escape = "\\") {}
/** @return array */
diff --git a/ext/spl/spl_directory_arginfo.h b/ext/spl/spl_directory_arginfo.h
index 7442c9c0e8..616f3f138f 100644
--- a/ext/spl/spl_directory_arginfo.h
+++ b/ext/spl/spl_directory_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 9127cb70a84f3e75ed16a17b15940b8a6b5f3937 */
+ * Stub hash: fc41da9a307965e501bcc7e912470cf650a3d70d */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0)
diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php
index 0b771fbd49..d0df30c056 100755
--- a/ext/standard/basic_functions.stub.php
+++ b/ext/standard/basic_functions.stub.php
@@ -745,7 +745,7 @@ function exec(string $command, &$output = null, &$result_code = null): string|fa
function system(string $command, &$result_code = null): string|false {}
/** @param int $result_code */
-function passthru(string $command, &$result_code = null): bool|null {}
+function passthru(string $command, &$result_code = null): ?bool {}
function escapeshellcmd(string $command): string {}
diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h
index e27c934c03..5717e5d336 100644
--- a/ext/standard/basic_functions_arginfo.h
+++ b/ext/standard/basic_functions_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 0224dc521c4a8bd49fbcfd26cddb01a2e571cf74 */
+ * Stub hash: 7cb3c95b61a57e5b88a37638dd90ff314cc89dd4 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
diff --git a/ext/zip/php_zip.stub.php b/ext/zip/php_zip.stub.php
index cde266261d..6b81a623b0 100644
--- a/ext/zip/php_zip.stub.php
+++ b/ext/zip/php_zip.stub.php
@@ -111,17 +111,17 @@ class ZipArchive
/** @return string|false */
public function getArchiveComment(int $flags = 0) {}
- /** @return null|false */
+ /** @return bool|null */
public function setCommentIndex(int $index, string $comment) {}
- /** @return null|false */
+ /** @return bool|null */
public function setCommentName(string $name, string $comment) {}
#ifdef HAVE_SET_MTIME
- /** @return null|false */
+ /** @return bool|null */
public function setMtimeIndex(int $index, int $timestamp, int $flags = 0) {}
- /** @return null|false */
+ /** @return bool|null */
public function setMtimeName(string $name, int $timestamp, int $flags = 0) {}
#endif
diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h
index c9f90d57f9..e657511969 100644
--- a/ext/zip/php_zip_arginfo.h
+++ b/ext/zip/php_zip_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 49f168c537e48f8a3998d67812a5e2e6a2463533 */
+ * Stub hash: d6e87c137cf1b372619b3890d04285d94d486c82 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)