From: Máté Kocsis Date: Sat, 1 Aug 2020 21:54:28 +0000 (+0200) Subject: Add a few missing types to stubs X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bdacd2ae8f872f9d1bff8279546f0d86772659d6;p=php Add a few missing types to stubs --- diff --git a/ext/exif/exif.stub.php b/ext/exif/exif.stub.php index b5db8bf02b..86e4cc5258 100644 --- a/ext/exif/exif.stub.php +++ b/ext/exif/exif.stub.php @@ -4,8 +4,10 @@ function exif_tagname(int $index): string|false {} +/** @param resource|string $filename */ function exif_read_data($filename, ?string $sections_needed = null, bool $sub_arrays = false, bool $read_thumbnail = false): array|false {} +/** @param resource|string $filename */ function exif_thumbnail($filename, &$width = null, &$height = null, &$imagetype = null): string|false {} function exif_imagetype(string $filename): int|false {} diff --git a/ext/exif/exif_arginfo.h b/ext/exif/exif_arginfo.h index dfe2d97e9b..5edef59fc6 100644 --- a/ext/exif/exif_arginfo.h +++ b/ext/exif/exif_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 603888c5295306e86fabce6d6f5367376c666cfe */ + * Stub hash: 62f6ca1a43c69d917711eae9118caf5a658722d9 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_exif_tagname, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) diff --git a/ext/odbc/odbc.stub.php b/ext/odbc/odbc.stub.php index bcd0cdbbc2..89371024eb 100644 --- a/ext/odbc/odbc.stub.php +++ b/ext/odbc/odbc.stub.php @@ -11,7 +11,7 @@ function odbc_binmode($result_id, int $mode): bool {} function odbc_longreadlen($result_id, int $length): bool {} /** - * @param resource $result_id + * @param resource $connection_id * @return resource|false */ function odbc_prepare($connection_id, string $query) {} @@ -48,7 +48,10 @@ function odbc_fetch_object($result, int $rownumber = -1): stdClass|false {} function odbc_fetch_array($result, int $rownumber = -1): array|false {} #endif -/** @param resource $result_id */ +/** + * @param resource $result_id + * @param array $result_array + */ function odbc_fetch_into($result_id, &$result_array, int $rownumber = 0): int|false {} /** @param resource $result_id */ diff --git a/ext/odbc/odbc_arginfo.h b/ext/odbc/odbc_arginfo.h index 69cdfa9148..2f5ffbe547 100644 --- a/ext/odbc/odbc_arginfo.h +++ b/ext/odbc/odbc_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4abab509eb27b93c15f03313e80c90400f7948d0 */ + * Stub hash: 14702a5bd87902871d456de2289f4ae236e5bfa5 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_close_all, 0, 0, IS_VOID, 0) ZEND_END_ARG_INFO() diff --git a/ext/openssl/openssl.stub.php b/ext/openssl/openssl.stub.php index 6e088204e0..3d2b0d87f8 100644 --- a/ext/openssl/openssl.stub.php +++ b/ext/openssl/openssl.stub.php @@ -16,6 +16,7 @@ final class OpenSSLAsymmetricKey function openssl_x509_export_to_file(OpenSSLCertificate|string $x509, string $outfilename, bool $notext = true): bool {} +/** @param string $out */ function openssl_x509_export(OpenSSLCertificate|string $x509, &$out, bool $notext = true): bool {} function openssl_x509_fingerprint(OpenSSLCertificate|string $x509, string $method = "sha1", bool $raw_output = false): string|false {} @@ -38,7 +39,10 @@ function openssl_x509_free(OpenSSLCertificate $x509): void {} /** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $priv_key */ function openssl_pkcs12_export_to_file(OpenSSLCertificate|string $x509cert, string $filename, $priv_key, string $pass, array $args = []): bool {} -/** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $priv_key */ +/** + * @param string $out + * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $priv_key + */ function openssl_pkcs12_export(OpenSSLCertificate|string $x509, &$out, $priv_key, string $pass, array $args = []): bool {} /** @param array $certs */ @@ -115,9 +119,10 @@ function openssl_pkcs7_sign(string $infile, string $outfile, OpenSSLCertificate| /** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string|null $recipkey */ function openssl_pkcs7_decrypt(string $infilename, string $outfilename, OpenSSLCertificate|string $recipcert, $recipkey = null): bool {} +/** @param array $certs */ function openssl_pkcs7_read(string $infilename, &$certs): bool {} -function openssl_cms_verify(string $filename, int $flags = 0, ?string $signerscerts = null, ?array $cainfo = null, ?string $extracerts = null, ?string $content = null, ?string $pk7 = null, ?string $sigfile = null, $encoding = OPENSSL_ENCODING_SMIME): bool {} +function openssl_cms_verify(string $filename, int $flags = 0, ?string $signerscerts = null, ?array $cainfo = null, ?string $extracerts = null, ?string $content = null, ?string $pk7 = null, ?string $sigfile = null, int $encoding = OPENSSL_ENCODING_SMIME): bool {} /** @param OpenSSLCertificate|array|string $recipcerts */ function openssl_cms_encrypt(string $infile, string $outfile, $recipcerts, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, int $cipher = OPENSSL_CIPHER_RC2_40): bool {} diff --git a/ext/openssl/openssl_arginfo.h b/ext/openssl/openssl_arginfo.h index dcb13d8f43..07f0d25391 100644 --- a/ext/openssl/openssl_arginfo.h +++ b/ext/openssl/openssl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 5189cc18305417d2566fe594f69806f72899c355 */ + * Stub hash: ed45da0e8786db9b20fd33d574b20f3d41304e0a */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_export_to_file, 0, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_TYPE_MASK(0, x509, OpenSSLCertificate, MAY_BE_STRING, NULL) @@ -208,7 +208,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_verify, 0, 1, _IS_BO ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, content, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pk7, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sigfile, IS_STRING, 1, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, encoding, "OPENSSL_ENCODING_SMIME") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_LONG, 0, "OPENSSL_ENCODING_SMIME") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_encrypt, 0, 4, _IS_BOOL, 0) diff --git a/ext/pcntl/pcntl.stub.php b/ext/pcntl/pcntl.stub.php index 8dbc1c48e2..3c1fd97968 100644 --- a/ext/pcntl/pcntl.stub.php +++ b/ext/pcntl/pcntl.stub.php @@ -4,13 +4,13 @@ function pcntl_fork(): int {} +/** @param int $status */ function pcntl_waitpid(int $pid, &$status, int $options = 0, &$rusage = []): int {} +/** @param int $status */ function pcntl_wait(&$status, int $options = 0, &$rusage = []): int {} -/** - * @param callable|int $handler - */ +/** @param callable|int $handler */ function pcntl_signal(int $signo, $handler, bool $restart_syscalls = true): bool {} /** @return mixed */ @@ -19,13 +19,16 @@ function pcntl_signal_get_handler(int $signo) {} function pcntl_signal_dispatch(): bool {} #ifdef HAVE_SIGPROCMASK +/** @param array $oldset */ function pcntl_sigprocmask(int $how, array $set, &$oldset = null): bool {} #endif #ifdef HAVE_STRUCT_SIGINFO_T #if defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT) +/** @param array $info */ function pcntl_sigwaitinfo(array $set, &$info = []): int|false {} +/** @param array $info */ function pcntl_sigtimedwait(array $set, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {} #endif #endif diff --git a/ext/pcntl/pcntl_arginfo.h b/ext/pcntl/pcntl_arginfo.h index 31dc8613c0..6e67d4613d 100644 --- a/ext/pcntl/pcntl_arginfo.h +++ b/ext/pcntl/pcntl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c87eae3de097554566cf3e285c1a2542947d6ff9 */ + * Stub hash: 243017c5440bff0b3ee3296705d8455d0fac5b7e */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_fork, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/ext/sodium/libsodium.stub.php b/ext/sodium/libsodium.stub.php index 73051b70cf..6429c3beba 100644 --- a/ext/sodium/libsodium.stub.php +++ b/ext/sodium/libsodium.stub.php @@ -78,7 +78,7 @@ function sodium_crypto_generichash_init(string $key = "", int $length = SODIUM_C function sodium_crypto_generichash_update(string &$state, string $string): bool {} -function sodium_crypto_generichash_final(string &$state, $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {} +function sodium_crypto_generichash_final(string &$state, int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {} function sodium_crypto_kdf_derive_from_key(int $subkey_len, int $subkey_id, string $context, string $key): string {} @@ -176,7 +176,7 @@ function sodium_unpad(string $string, int $block_size): string {} function sodium_bin2hex(string $string): string {} -function sodium_hex2bin(string $string, $ignore = ""): string {} +function sodium_hex2bin(string $string, string $ignore = ""): string {} #ifdef sodium_base64_VARIANT_ORIGINAL function sodium_bin2base64(string $string, int $id): string {} diff --git a/ext/sodium/libsodium_arginfo.h b/ext/sodium/libsodium_arginfo.h index 518490618e..4f06398bde 100644 --- a/ext/sodium/libsodium_arginfo.h +++ b/ext/sodium/libsodium_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 1cbca4f3d58dea842b4ea419df57531682ab984d */ + * Stub hash: 5d064655caf10f5e0dd126009755bf3552c63f59 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_is_available, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() @@ -162,7 +162,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash_final, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, length, "SODIUM_CRYPTO_GENERICHASH_BYTES") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "SODIUM_CRYPTO_GENERICHASH_BYTES") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_kdf_derive_from_key, 0, 4, IS_STRING, 0) @@ -363,7 +363,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_hex2bin, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, ignore, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ignore, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() #if defined(sodium_base64_VARIANT_ORIGINAL)