[+]: re-add some more fixes

-> found via https://github.com/voku/phpstorm-stubs/tree/return_type_fixes_v2
This commit is contained in:
Lars Moelleken 2019-07-04 22:10:34 +02:00
parent f161ec38d8
commit ee38c94254
8 changed files with 34 additions and 33 deletions

View File

@ -341,7 +341,7 @@ function dba_list () {}
* @param mixed $key <p>
* The key in string representation.
* </p>
* @return mixed an array of the form array(0 =&gt; group, 1 =&gt;
* @return array|false an array of the form array(0 =&gt; group, 1 =&gt;
* value_name). This function will return <b>FALSE</b> if
* <i>key</i> is <b>NULL</b> or <b>FALSE</b>.
* @since 5.0

View File

@ -10,7 +10,7 @@
* @param SimpleXMLElement $node <p>
* The <b>SimpleXMLElement</b> node.
* </p>
* @return DOMElement The <b>DOMElement</b> node added or <b>FALSE</b> if any errors occur.
* @return DOMElement|false The <b>DOMElement</b> node added or <b>FALSE</b> if any errors occur.
*/
function dom_import_simplexml (SimpleXMLElement $node) {}
@ -116,7 +116,7 @@ define ('DOM_PHP_ERR', 0);
define ('DOM_INDEX_SIZE_ERR', 1);
/**
* If the specified range of text does not fit into a
* If the specified range of text does not fit into a
* <b>DOMString</b>.
* @link https://php.net/manual/en/dom.constants.php
*/
@ -189,7 +189,7 @@ define ('DOM_SYNTAX_ERR', 12);
define ('DOM_INVALID_MODIFICATION_ERR', 13);
/**
* If an attempt is made to create or change an object in a way which is
* If an attempt is made to create or change an object in a way which is
* incorrect with regard to namespaces.
* @link https://php.net/manual/en/dom.constants.php
*/
@ -203,7 +203,7 @@ define ('DOM_INVALID_ACCESS_ERR', 15);
/**
* If a call to a method such as insertBefore or removeChild would make the Node
* invalid with respect to "partial validity", this exception would be raised and
* invalid with respect to "partial validity", this exception would be raised and
* the operation would not be done.
* @link https://php.net/manual/en/dom.constants.php
*/

View File

@ -33,8 +33,8 @@ function iconv ($in_charset, $out_charset, $str) {}
/**
* Convert character encoding as output buffer handler
* @link https://php.net/manual/en/function.ob-iconv-handler.php
* @param string $contents
* @param int $status
* @param string $contents
* @param int $status
* @return string See <b>ob_start</b> for information about this handler
* return values.
* @since 4.0.5
@ -93,7 +93,7 @@ function iconv_set_encoding ($type, $charset) {}
* <i>str</i> is assumed to be encoded in
* iconv.internal_encoding.
* </p>
* @return int the character count of <i>str</i>, as an integer.
* @return int|false the character count of <i>str</i>, as an integer. False on error.
* @since 5.0
*/
function iconv_strlen ($str, $charset = 'ini_get("iconv.internal_encoding")') {}

View File

@ -4363,7 +4363,7 @@ function datefmt_get_error_message(MessageFormatter $mf, $coll) { }
* @param string $input <p>
* The string being measured for length. It must be a valid UTF-8 string.
* </p>
* @return int The length of the string on success, and 0 if the string is empty.
* @return int|false|null The length of the string on success, and 0 if the string is empty.
*/
function grapheme_strlen($input) { }
@ -4543,7 +4543,7 @@ function grapheme_stristr($haystack, $needle, $before_needle = false) { }
* Reference to a value that will be set to the next starting position.
* When the call returns, this may point to the first byte position past the end of the string.
* </p>
* @return string A string starting at offset $start and ending on a default grapheme cluster
* @return string|false A string starting at offset $start and ending on a default grapheme cluster
* boundary that conforms to the $size and $extract_type specified.
*/
function grapheme_extract($haystack, $size, $extract_type = null, $start = 0, &$next = null) { }
@ -5740,7 +5740,7 @@ function resourcebundle_get_error_message(ResourceBundle $bundle) { }
* May also be set to
* Transliterator::REVERSE.
* </p>
* @return Transliterator a <b>Transliterator</b> object on success,
* @return Transliterator|null a <b>Transliterator</b> object on success,
* or <b>NULL</b> on failure.
*/
function transliterator_create($id, $direction = null) { }

View File

@ -1724,7 +1724,7 @@ function mysqli_fetch_lengths ($result) {}
* @param mysqli_result $result A result set identifier returned by mysqli_query(),
* mysqli_store_result() or mysqli_use_result().
* @param int $resulttype
* @return array|null Returns an array of associative or numeric arrays holding result rows.
* @return array Returns an array of associative or numeric arrays holding result rows.
*/
function mysqli_fetch_all ($result, $resulttype = MYSQLI_NUM) {}
@ -1743,7 +1743,7 @@ function mysqli_fetch_array ($result, $resulttype = MYSQLI_BOTH) {}
* @link https://php.net/manual/en/mysqli-result.fetch-assoc.php
* @param mysqli_result $result A result set identifier returned by mysqli_query(),
* mysqli_store_result() or mysqli_use_result().
* @return array|null Returns an associative array of strings representing the fetched row in the result set,
* @return string[]|null Returns an associative array of strings representing the fetched row in the result set,
* where each key in the array represents the name of one of the result set's columns or NULL if there are no more rows in resultset.
* If two or more columns of the result have the same field names, the last column will take precedence.
* To access the other column(s) of the same name,
@ -2506,7 +2506,7 @@ function mysqli_stmt_store_result ($stmt) {}
* Transfers a result set from the last query
* @link https://php.net/manual/en/mysqli.store-result.php
* @param mysqli $link A link identifier returned by mysqli_connect() or mysqli_init()
* @return mysqli_result|bool
* @return mysqli_result|false
*/
function mysqli_store_result ($link) {}
@ -2529,7 +2529,7 @@ function mysqli_thread_safe () {}
* Initiate a result set retrieval
* @link https://php.net/manual/en/mysqli.use-result.php
* @param mysqli $link A link identifier returned by mysqli_connect() or mysqli_init()
* @return mysqli_result|bool
* @return mysqli_result|false
*/
function mysqli_use_result ($link) {}

View File

@ -273,7 +273,7 @@ function openssl_x509_free($x509cert) { }
* fields will be indexed with the short name form, otherwise, the long name
* form will be used - e.g.: CN is the shortname form of commonName.
* </p>
* @return array The structure of the returned data is (deliberately) not
* @return array|false The structure of the returned data is (deliberately) not
* yet documented, as it is still subject to change.
* @since 4.0.6
* @since 5.0
@ -337,7 +337,7 @@ function openssl_x509_parse($x509cert, $shortnames = true) { }
* certificates that can be used to help verify the certificate, although
* no trust is placed in the certificates that come from that file.
* </p>
* @return int true if the certificate can be used for the intended purpose,
* @return int|bool true if the certificate can be used for the intended purpose,
* false if it cannot, or -1 on error.
* @since 4.0.6
* @since 5.0
@ -532,7 +532,7 @@ function openssl_pkcs12_read($pkcs12, array &$certs, $pass) { }
* <i>extraattribs</i> are associative arrays whose keys are
* converted to OIDs and applied to the relevant part of the request.
* </p>
* @return mixed the CSR.
* @return false|resource the CSR.
* @since 4.2.0
* @since 5.0
*/
@ -606,7 +606,7 @@ function openssl_csr_sign($csr, $cacert, $priv_key, $days, array $configargs = n
* @link https://php.net/manual/en/function.openssl-csr-get-subject.php
* @param mixed $csr
* @param bool $use_shortnames [optional]
* @return array
* @return array|false
* @since 5.2.0
*/
function openssl_csr_get_subject($csr, $use_shortnames = true) { }
@ -616,7 +616,7 @@ function openssl_csr_get_subject($csr, $use_shortnames = true) { }
* @link https://php.net/manual/en/function.openssl-csr-get-public-key.php
* @param mixed $csr
* @param bool $use_shortnames [optional]
* @return resource
* @return resource|false
* @since 5.2.0
*/
function openssl_csr_get_public_key($csr, $use_shortnames = true) { }
@ -822,7 +822,7 @@ function openssl_pbkdf2($password, $salt, $key_length, $iterations, $digest_algo
* stripped.
* @param string|null $pk7 [optional]
* </p>
* @return mixed true if the signature is verified, false if it is not correct
* @return bool|int true if the signature is verified, false if it is not correct
* (the message has been tampered with, or the signing certificate is invalid),
* or -1 on error.
* @since 4.0.6

View File

@ -31,7 +31,7 @@
* <b>socket_select</b> can block indefinitely.
* </p>
* @param int $tv_usec [optional]
* @return int On success <b>socket_select</b> returns the number of
* @return int|false On success <b>socket_select</b> returns the number of
* socket resources contained in the modified arrays, which may be zero if
* the timeout expires before anything interesting happens. On error <b>FALSE</b>
* is returned. The error code can be retrieved with
@ -184,7 +184,7 @@ function socket_select (array &$read, array &$write, array &$except, $tv_sec, $t
* </td>
* </tr>
* </table>
* @return resource <b>socket_create</b> returns a socket resource on success,
* @return resource|false <b>socket_create</b> returns a socket resource on success,
* or <b>FALSE</b> on error. The actual error code can be retrieved by calling
* <b>socket_last_error</b>. This error code may be passed to
* <b>socket_strerror</b> to get a textual explanation of the
@ -212,7 +212,7 @@ function socket_export_stream($socket) {}
* <i>backlog</i> parameter, see
* <b>socket_listen</b> for more information.
* </p>
* @return resource <b>socket_create_listen</b> returns a new socket resource
* @return resource|false <b>socket_create_listen</b> returns a new socket resource
* on success or <b>FALSE</b> on error. The error code can be retrieved with
* <b>socket_last_error</b>. This code may be passed to
* <b>socket_strerror</b> to get a textual explanation of the
@ -390,7 +390,7 @@ function socket_write ($socket, $buffer, $length = 0) {}
* Optional <i>type</i> parameter is a named constant:
* <b>PHP_BINARY_READ</b> (Default) - use the system
* recv() function. Safe for reading binary data.
* @return string <b>socket_read</b> returns the data as a string on success,
* @return string|false <b>socket_read</b> returns the data as a string on success,
* or <b>FALSE</b> on error (including if the remote host has closed the
* connection). The error code can be retrieved with
* <b>socket_last_error</b>. This code may be passed to
@ -607,7 +607,7 @@ function socket_bind ($socket, $address, $port = 0) {}
* </td>
* </tr>
* </table>
* @return int <b>socket_recv</b> returns the number of bytes received,
* @return int|false <b>socket_recv</b> returns the number of bytes received,
* or <b>FALSE</b> if there was an error. The actual error code can be retrieved by
* calling <b>socket_last_error</b>. This error code may be
* passed to <b>socket_strerror</b> to get a textual explanation
@ -678,7 +678,7 @@ function socket_send ($socket, $buf, $len, $flags) {}
* @param resource $socket
* @param array $message
* @param int $flags
* @return int
* @return int|false
* @since 5.5.0
*/
function socket_sendmsg ($socket, array $message, $flags ) {}
@ -749,7 +749,7 @@ function socket_sendmsg ($socket, array $message, $flags ) {}
* from which the data is received. If the socket is connection-oriented,
* <i>port</i> will be <b>NULL</b>.
* </p>
* @return int <b>socket_recvfrom</b> returns the number of bytes received,
* @return int|false <b>socket_recvfrom</b> returns the number of bytes received,
* or <b>FALSE</b> if there was an error. The actual error code can be retrieved by
* calling <b>socket_last_error</b>. This error code may be
* passed to <b>socket_strerror</b> to get a textual explanation
@ -765,10 +765,11 @@ function socket_recvfrom ($socket, &$buf, $len, $flags, &$name, &$port = null) {
* @param resource $socket
* @param string $message
* @param int $flags [optional]
* @return int
* @return int|false
* @since 5.5.0
*/
function socket_recvmsg ($socket , $message, $flags) {}
/**
* Sends a message to a socket, whether it is connected or not
* @link https://php.net/manual/en/function.socket-sendto.php
@ -823,7 +824,7 @@ function socket_recvmsg ($socket , $message, $flags) {}
* <i>port</i> is the remote port number at which the data
* will be sent.
* </p>
* @return int <b>socket_sendto</b> returns the number of bytes sent to the
* @return int|false <b>socket_sendto</b> returns the number of bytes sent to the
* remote host, or <b>FALSE</b> if an error occurred.
* @since 4.1.0
* @since 5.0
@ -1192,7 +1193,7 @@ function socket_sendto ($socket, $buf, $len, $flags, $addr, $port = 0) {}
* </td>
* </tr>
* </table>
* @return mixed the value of the given option, or <b>FALSE</b> on errors.
* @return mixed|false the value of the given option, or <b>FALSE</b> on errors.
* @since 4.3.0
* @since 5.0
*/

View File

@ -1237,7 +1237,7 @@ function sqlsrv_query($conn, $tsql, $params=array(), $options=array()){}
* {@link http://msdn.microsoft.com/en-us/library/ee376927.aspx Specifying a Cursor Type and Selecting Rows}.
* @param int|null $offset [optional] Used with SQLSRV_SCROLL_ABSOLUTE and SQLSRV_SCROLL_RELATIVE to specify the row to
* retrieve. The first record in the result set is 0.
* @return array|null|false If the next row of the result set was successfully retrieved, true is returned. If there are
* @return bool|null If the next row of the result set was successfully retrieved, true is returned. If there are
* no more results in the result set, null is returned. If an error occurred, false is returned.
*/
function sqlsrv_fetch($stmt, $row=null, $offset=null){}
@ -1448,7 +1448,7 @@ function sqlsrv_rows_affected($stmt){}
*
* @link https://docs.microsoft.com/en-us/sql/connect/php/sqlsrv-client-info
* @param resource $conn The connection resource by which the client is connected.
* @return array|null An associative array with keys described in the table below, or false if the connection resource
* @return array|false An associative array with keys described in the table below, or false if the connection resource
* is null.<br />
* <ul><li>DriverDllName - SQLNCLI10.DLL (Microsoft Drivers for PHP for SQL Server version 2.0)</li>
* <li>DriverODBCVer - ODBC version (xx.yy)</li>