]> granicus.if.org Git - php/commitdiff
Display types in stubs more uniformly
authorMáté Kocsis <kocsismate@woohoolabs.com>
Wed, 16 Sep 2020 19:19:36 +0000 (21:19 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Wed, 16 Sep 2020 19:19:36 +0000 (21:19 +0200)
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.

18 files changed:
ext/dom/php_dom.stub.php
ext/dom/php_dom_arginfo.h
ext/imap/php_imap.stub.php
ext/imap/php_imap_arginfo.h
ext/intl/php_intl.stub.php
ext/intl/php_intl_arginfo.h
ext/oci8/oci8.stub.php
ext/oci8/oci8_arginfo.h
ext/pdo/pdo_stmt.stub.php
ext/pdo/pdo_stmt_arginfo.h
ext/sockets/sockets.stub.php
ext/sockets/sockets_arginfo.h
ext/spl/spl_directory.stub.php
ext/spl/spl_directory_arginfo.h
ext/standard/basic_functions.stub.php
ext/standard/basic_functions_arginfo.h
ext/zip/php_zip.stub.php
ext/zip/php_zip_arginfo.h

index 8ed6723250bf89911ca858b97eaebfc32855888d..5f15f99e174e59822643d457eae026802545cd1e 100644 (file)
@@ -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 */
index 7da82ba710fc1a5fa08cb2cb8f3d6dd8e96c2386..d5da40e46393f7fdd279832f1e24a8ca918dee0a 100644 (file)
@@ -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)
index fb83dc6c5497f62da856fd61762b00cf6b89f179..d707af161c29a7f1d2be13fa36e37c68944691c6 100644 (file)
@@ -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 {}
 
index fd679f99538d757358f38e11be61850a002259b7..013ef9096c7aa9c85f366bd2c15d77ebb0268e81 100644 (file)
@@ -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)
index f2a1af1c2e2e0112823c71e657d61a9f6eb2692a..67bd27be92a0f64f34174b64aba7887a6ccad9e1 100644 (file)
@@ -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 {}
 
index 32f098d0bb87843b660cbeb826b01a92b638b7d2..1b1c0ea84dcf2259b9ac7e3711776aff299bd853 100644 (file)
@@ -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")
index 917225f562655fad96a2e3796b77e56cdd1288cb..58eb984f94c63255d856790d9d15f67aa4e7a82c 100644 (file)
@@ -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
index 0bcc18f06a1fc589717f89212183f645ea3d9d30..b385554bdfa58d6e46fa7a37a480b4e074b99c1a 100644 (file)
@@ -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)
index d0141ceb45eaf85380da8bba919e2ec7e564510e..b280f73ffdb3d32db30a005cd0f06d079357d067 100644 (file)
@@ -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 */
index c05606c6faac79039e66f33003f68fb0208ea30d..116449ad3aefec8dcf8b3a7bab45d9fde0d5d134 100644 (file)
@@ -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)
index 547374fe97bd5f74079b1340c4d6737eca8f4e0b..8acab114e563d9a9ecee6fdf1246766adbe14a1c 100644 (file)
@@ -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
index e7f4c04799397db1696832abb385da393d7de77e..0923918a9419c477b41facabd54ce3aa812f8159 100644 (file)
@@ -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)
index 4691378ca9b713d5b0ce243c7bd39d28c2c702a1..0e942a2e12bf5030d4654e698c1cff50417ce9de 100755 (executable)
@@ -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 */
index 7442c9c0e88e15cab43432e947806a2961a0c2cf..616f3f138fa8a3ef52ef300a45e24cc28b27210e 100644 (file)
@@ -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)
index 0b771fbd491892d8120677073f5f684da1cf6810..d0df30c0564c8b93b67334aad03be2db4fda0e08 100755 (executable)
@@ -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 {}
 
index e27c934c0371fbd30935b091f3c2dec70f1c65cc..5717e5d336c29d1755e7a8643dff0ce4aa226779 100644 (file)
@@ -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)
index cde266261d64000ebce8ec94bd57606256f8f877..6b81a623b0734857a904c17b6d50db38bea71721 100644 (file)
@@ -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
 
index c9f90d57f9873c80ddec713e415dc913685acedc..e657511969e1fb6deb1e3153fadf7ac34f38c1ff 100644 (file)
@@ -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)