diff --git a/generated/8.1/functionsList.php b/generated/8.1/functionsList.php index 2aae135b..b3b3f39e 100644 --- a/generated/8.1/functionsList.php +++ b/generated/8.1/functionsList.php @@ -4,8 +4,6 @@ 'apache_getenv', 'apache_get_version', 'apache_lookup_uri', - 'apache_request_headers', - 'apache_response_headers', 'apache_setenv', 'apcu_cache_info', 'apcu_cas', @@ -13,11 +11,6 @@ 'apcu_fetch', 'apcu_inc', 'apcu_sma_info', - 'array_combine', - 'array_flip', - 'array_replace', - 'array_replace_recursive', - 'array_walk_recursive', 'assert_options', 'base64_decode', 'bindtextdomain', @@ -106,15 +99,11 @@ 'curl_multi_init', 'curl_multi_setopt', 'curl_setopt', - 'curl_share_errno', 'curl_share_setopt', 'curl_unescape', - 'date', - 'date_parse', 'date_parse_from_format', 'date_sunrise', 'date_sunset', - 'date_sun_info', 'db2_autocommit', 'db2_bind_param', 'db2_client_info', @@ -232,7 +221,6 @@ 'ftp_systype', 'ftruncate', 'fwrite', - 'getallheaders', 'getcwd', 'gethostname', 'getimagesize', @@ -252,7 +240,6 @@ 'get_meta_tags', 'glob', 'gmmktime', - 'gmp_random_seed', 'gmstrftime', 'gnupg_adddecryptkey', 'gnupg_addencryptkey', @@ -277,7 +264,6 @@ 'gztell', 'gzuncompress', 'gzwrite', - 'hash_hkdf', 'hash_update_file', 'header_register_callback', 'hex2bin', @@ -328,7 +314,6 @@ 'imagecolordeallocate', 'imagecolormatch', 'imagecolorset', - 'imagecolorsforindex', 'imageconvolution', 'imagecopy', 'imagecopymerge', @@ -390,8 +375,6 @@ 'imagesettile', 'imagestring', 'imagestringup', - 'imagesx', - 'imagesy', 'imagetruecolortopalette', 'imagettfbbox', 'imagettftext', @@ -498,7 +481,6 @@ 'ldap_unbind', 'libxml_set_external_entity_loader', 'link', - 'long2ip', 'lstat', 'lzf_compress', 'lzf_decompress', @@ -538,7 +520,6 @@ 'msg_send', 'msg_set_queue', 'msg_stat_queue', - 'mysqli_get_client_stats', 'mysql_close', 'mysql_connect', 'mysql_create_db', @@ -678,6 +659,7 @@ 'openssl_pkey_derive', 'openssl_pkey_export', 'openssl_pkey_export_to_file', + 'openssl_pkey_get_details', 'openssl_pkey_get_private', 'openssl_pkey_get_public', 'openssl_pkey_new', @@ -685,7 +667,6 @@ 'openssl_private_encrypt', 'openssl_public_decrypt', 'openssl_public_encrypt', - 'openssl_random_pseudo_bytes', 'openssl_seal', 'openssl_sign', 'openssl_spki_export', @@ -700,7 +681,6 @@ 'openssl_x509_read', 'output_add_rewrite_var', 'output_reset_rewrite_vars', - 'pack', 'parse_ini_file', 'parse_ini_string', 'parse_url', @@ -934,11 +914,9 @@ 'shm_put_var', 'shm_remove', 'shm_remove_var', - 'shuffle', 'simplexml_import_dom', 'simplexml_load_file', 'simplexml_load_string', - 'sleep', 'socket_accept', 'socket_addrinfo_bind', 'socket_addrinfo_connect', @@ -1039,6 +1017,7 @@ 'stream_set_timeout', 'stream_socket_accept', 'stream_socket_client', + 'stream_socket_get_name', 'stream_socket_pair', 'stream_socket_server', 'stream_socket_shutdown', diff --git a/generated/8.1/info.php b/generated/8.1/info.php index ee31a1c5..74883146 100644 --- a/generated/8.1/info.php +++ b/generated/8.1/info.php @@ -417,12 +417,12 @@ function ini_get(string $option): string * @param string $option Not all the available options can be changed using * ini_set. There is a list of all available options * in the appendix. - * @param string $value The new value for the option. + * @param bool|float|int|null|string $value The new value for the option. * @return string Returns the old value on success. * @throws InfoException * */ -function ini_set(string $option, string $value): string +function ini_set(string $option, $value): string { error_clear_last(); $safeResult = \ini_set($option, $value); diff --git a/generated/8.1/openssl.php b/generated/8.1/openssl.php index 2feace0e..ff29aa80 100644 --- a/generated/8.1/openssl.php +++ b/generated/8.1/openssl.php @@ -943,6 +943,35 @@ function openssl_pkey_export($key, ?string &$output, ?string $passphrase = null, } +/** + * This function returns the key details (bits, key, type). + * + * @param \OpenSSLAsymmetricKey $key Resource holding the key. + * @return array Returns an array with the key details in success or FALSE in failure. + * Returned array has indexes bits (number of bits), + * key (string representation of the public key) and + * type (type of the key which is one of + * OPENSSL_KEYTYPE_RSA, + * OPENSSL_KEYTYPE_DSA, + * OPENSSL_KEYTYPE_DH, + * OPENSSL_KEYTYPE_EC or -1 meaning unknown). + * + * Depending on the key type used, additional details may be returned. Note that + * some elements may not always be available. + * @throws OpensslException + * + */ +function openssl_pkey_get_details(\OpenSSLAsymmetricKey $key): array +{ + error_clear_last(); + $safeResult = \openssl_pkey_get_details($key); + if ($safeResult === false) { + throw OpensslException::createFromPhpError(); + } + return $safeResult; +} + + /** * openssl_pkey_get_private parses * private_key and prepares it for use by other functions. diff --git a/generated/8.1/rector-migrate.php b/generated/8.1/rector-migrate.php index 051c758f..334aa51e 100644 --- a/generated/8.1/rector-migrate.php +++ b/generated/8.1/rector-migrate.php @@ -12,8 +12,6 @@ [ 'apache_getenv' => 'Safe\apache_getenv', 'apache_get_version' => 'Safe\apache_get_version', 'apache_lookup_uri' => 'Safe\apache_lookup_uri', - 'apache_request_headers' => 'Safe\apache_request_headers', - 'apache_response_headers' => 'Safe\apache_response_headers', 'apache_setenv' => 'Safe\apache_setenv', 'apcu_cache_info' => 'Safe\apcu_cache_info', 'apcu_cas' => 'Safe\apcu_cas', @@ -21,11 +19,6 @@ 'apcu_fetch' => 'Safe\apcu_fetch', 'apcu_inc' => 'Safe\apcu_inc', 'apcu_sma_info' => 'Safe\apcu_sma_info', - 'array_combine' => 'Safe\array_combine', - 'array_flip' => 'Safe\array_flip', - 'array_replace' => 'Safe\array_replace', - 'array_replace_recursive' => 'Safe\array_replace_recursive', - 'array_walk_recursive' => 'Safe\array_walk_recursive', 'assert_options' => 'Safe\assert_options', 'base64_decode' => 'Safe\base64_decode', 'bindtextdomain' => 'Safe\bindtextdomain', @@ -114,15 +107,11 @@ 'curl_multi_init' => 'Safe\curl_multi_init', 'curl_multi_setopt' => 'Safe\curl_multi_setopt', 'curl_setopt' => 'Safe\curl_setopt', - 'curl_share_errno' => 'Safe\curl_share_errno', 'curl_share_setopt' => 'Safe\curl_share_setopt', 'curl_unescape' => 'Safe\curl_unescape', - 'date' => 'Safe\date', - 'date_parse' => 'Safe\date_parse', 'date_parse_from_format' => 'Safe\date_parse_from_format', 'date_sunrise' => 'Safe\date_sunrise', 'date_sunset' => 'Safe\date_sunset', - 'date_sun_info' => 'Safe\date_sun_info', 'db2_autocommit' => 'Safe\db2_autocommit', 'db2_bind_param' => 'Safe\db2_bind_param', 'db2_client_info' => 'Safe\db2_client_info', @@ -240,7 +229,6 @@ 'ftp_systype' => 'Safe\ftp_systype', 'ftruncate' => 'Safe\ftruncate', 'fwrite' => 'Safe\fwrite', - 'getallheaders' => 'Safe\getallheaders', 'getcwd' => 'Safe\getcwd', 'gethostname' => 'Safe\gethostname', 'getimagesize' => 'Safe\getimagesize', @@ -260,7 +248,6 @@ 'get_meta_tags' => 'Safe\get_meta_tags', 'glob' => 'Safe\glob', 'gmmktime' => 'Safe\gmmktime', - 'gmp_random_seed' => 'Safe\gmp_random_seed', 'gmstrftime' => 'Safe\gmstrftime', 'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey', 'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey', @@ -285,7 +272,6 @@ 'gztell' => 'Safe\gztell', 'gzuncompress' => 'Safe\gzuncompress', 'gzwrite' => 'Safe\gzwrite', - 'hash_hkdf' => 'Safe\hash_hkdf', 'hash_update_file' => 'Safe\hash_update_file', 'header_register_callback' => 'Safe\header_register_callback', 'hex2bin' => 'Safe\hex2bin', @@ -336,7 +322,6 @@ 'imagecolordeallocate' => 'Safe\imagecolordeallocate', 'imagecolormatch' => 'Safe\imagecolormatch', 'imagecolorset' => 'Safe\imagecolorset', - 'imagecolorsforindex' => 'Safe\imagecolorsforindex', 'imageconvolution' => 'Safe\imageconvolution', 'imagecopy' => 'Safe\imagecopy', 'imagecopymerge' => 'Safe\imagecopymerge', @@ -398,8 +383,6 @@ 'imagesettile' => 'Safe\imagesettile', 'imagestring' => 'Safe\imagestring', 'imagestringup' => 'Safe\imagestringup', - 'imagesx' => 'Safe\imagesx', - 'imagesy' => 'Safe\imagesy', 'imagetruecolortopalette' => 'Safe\imagetruecolortopalette', 'imagettfbbox' => 'Safe\imagettfbbox', 'imagettftext' => 'Safe\imagettftext', @@ -506,7 +489,6 @@ 'ldap_unbind' => 'Safe\ldap_unbind', 'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader', 'link' => 'Safe\link', - 'long2ip' => 'Safe\long2ip', 'lstat' => 'Safe\lstat', 'lzf_compress' => 'Safe\lzf_compress', 'lzf_decompress' => 'Safe\lzf_decompress', @@ -546,7 +528,6 @@ 'msg_send' => 'Safe\msg_send', 'msg_set_queue' => 'Safe\msg_set_queue', 'msg_stat_queue' => 'Safe\msg_stat_queue', - 'mysqli_get_client_stats' => 'Safe\mysqli_get_client_stats', 'mysql_close' => 'Safe\mysql_close', 'mysql_connect' => 'Safe\mysql_connect', 'mysql_create_db' => 'Safe\mysql_create_db', @@ -686,6 +667,7 @@ 'openssl_pkey_derive' => 'Safe\openssl_pkey_derive', 'openssl_pkey_export' => 'Safe\openssl_pkey_export', 'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file', + 'openssl_pkey_get_details' => 'Safe\openssl_pkey_get_details', 'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private', 'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public', 'openssl_pkey_new' => 'Safe\openssl_pkey_new', @@ -693,7 +675,6 @@ 'openssl_private_encrypt' => 'Safe\openssl_private_encrypt', 'openssl_public_decrypt' => 'Safe\openssl_public_decrypt', 'openssl_public_encrypt' => 'Safe\openssl_public_encrypt', - 'openssl_random_pseudo_bytes' => 'Safe\openssl_random_pseudo_bytes', 'openssl_seal' => 'Safe\openssl_seal', 'openssl_sign' => 'Safe\openssl_sign', 'openssl_spki_export' => 'Safe\openssl_spki_export', @@ -708,7 +689,6 @@ 'openssl_x509_read' => 'Safe\openssl_x509_read', 'output_add_rewrite_var' => 'Safe\output_add_rewrite_var', 'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars', - 'pack' => 'Safe\pack', 'parse_ini_file' => 'Safe\parse_ini_file', 'parse_ini_string' => 'Safe\parse_ini_string', 'parse_url' => 'Safe\parse_url', @@ -942,11 +922,9 @@ 'shm_put_var' => 'Safe\shm_put_var', 'shm_remove' => 'Safe\shm_remove', 'shm_remove_var' => 'Safe\shm_remove_var', - 'shuffle' => 'Safe\shuffle', 'simplexml_import_dom' => 'Safe\simplexml_import_dom', 'simplexml_load_file' => 'Safe\simplexml_load_file', 'simplexml_load_string' => 'Safe\simplexml_load_string', - 'sleep' => 'Safe\sleep', 'socket_accept' => 'Safe\socket_accept', 'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind', 'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect', @@ -1047,6 +1025,7 @@ 'stream_set_timeout' => 'Safe\stream_set_timeout', 'stream_socket_accept' => 'Safe\stream_socket_accept', 'stream_socket_client' => 'Safe\stream_socket_client', + 'stream_socket_get_name' => 'Safe\stream_socket_get_name', 'stream_socket_pair' => 'Safe\stream_socket_pair', 'stream_socket_server' => 'Safe\stream_socket_server', 'stream_socket_shutdown' => 'Safe\stream_socket_shutdown', diff --git a/generated/8.1/stream.php b/generated/8.1/stream.php index 64ea8a01..0dfed719 100644 --- a/generated/8.1/stream.php +++ b/generated/8.1/stream.php @@ -456,6 +456,27 @@ function stream_socket_client(string $remote_socket, ?int &$errno = null, ?strin } +/** + * Returns the local or remote name of a given socket connection. + * + * @param resource $handle The socket to get the name of. + * @param bool $want_peer If set to TRUE the remote socket name will be returned, if set + * to FALSE the local socket name will be returned. + * @return string The name of the socket. + * @throws StreamException + * + */ +function stream_socket_get_name($handle, bool $want_peer): string +{ + error_clear_last(); + $safeResult = \stream_socket_get_name($handle, $want_peer); + if ($safeResult === false) { + throw StreamException::createFromPhpError(); + } + return $safeResult; +} + + /** * stream_socket_pair creates a pair of connected, * indistinguishable socket streams. This function is commonly used in IPC diff --git a/generated/8.2/datetime.php b/generated/8.2/datetime.php index c3fa9585..b4f26c55 100644 --- a/generated/8.2/datetime.php +++ b/generated/8.2/datetime.php @@ -4,6 +4,36 @@ use Safe\Exceptions\DatetimeException; +/** + * This is the procedural version of + * DateTime::__construct. + * + * Unlike the DateTime constructor, it will return + * FALSE instead of an exception if the passed in + * datetime string is invalid. + * + * @param null|string $datetime + * @param \DateTimeZone|null $timezone + * @return \DateTime Returns a new DateTime instance. + * Procedural style returns FALSE on failure. + * @throws DatetimeException + * + */ +function date_create(?string $datetime = "now", ?\DateTimeZone $timezone = null): \DateTime +{ + error_clear_last(); + if ($timezone !== null) { + $safeResult = \date_create($datetime, $timezone); + } else { + $safeResult = \date_create($datetime); + } + if ($safeResult === false) { + throw DatetimeException::createFromPhpError(); + } + return $safeResult; +} + + /** * Returns associative array with detailed info about given date/time. * @@ -730,11 +760,12 @@ function idate(string $format, ?int $timestamp = null): int * 1970-2000. On systems where time_t is a 32bit signed integer, as * most common today, the valid range for year * is somewhere between 1901 and 2038. - * @return false|int mktime returns the Unix timestamp of the arguments + * @return int mktime returns the Unix timestamp of the arguments * given. + * @throws DatetimeException * */ -function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null) +function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int { error_clear_last(); if ($year !== null) { @@ -750,6 +781,9 @@ function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month } else { $safeResult = \mktime($hour); } + if ($safeResult === false) { + throw DatetimeException::createFromPhpError(); + } return $safeResult; } diff --git a/generated/8.2/functionsList.php b/generated/8.2/functionsList.php index ee336c6c..bb161c46 100644 --- a/generated/8.2/functionsList.php +++ b/generated/8.2/functionsList.php @@ -4,8 +4,6 @@ 'apache_getenv', 'apache_get_version', 'apache_lookup_uri', - 'apache_request_headers', - 'apache_response_headers', 'apache_setenv', 'apcu_cache_info', 'apcu_cas', @@ -13,7 +11,6 @@ 'apcu_fetch', 'apcu_inc', 'apcu_sma_info', - 'array_walk_recursive', 'assert_options', 'base64_decode', 'bindtextdomain', @@ -102,16 +99,13 @@ 'curl_multi_init', 'curl_multi_setopt', 'curl_setopt', - 'curl_share_errno', 'curl_share_setopt', 'curl_unescape', 'curl_upkeep', - 'date', - 'date_parse', + 'date_create', 'date_parse_from_format', 'date_sunrise', 'date_sunset', - 'date_sun_info', 'db2_autocommit', 'db2_bind_param', 'db2_client_info', @@ -231,7 +225,6 @@ 'ftp_systype', 'ftruncate', 'fwrite', - 'getallheaders', 'getcwd', 'gethostname', 'getimagesize', @@ -387,8 +380,6 @@ 'imagesettile', 'imagestring', 'imagestringup', - 'imagesx', - 'imagesy', 'imagetruecolortopalette', 'imagettfbbox', 'imagettftext', @@ -495,7 +486,6 @@ 'ldap_unbind', 'libxml_set_external_entity_loader', 'link', - 'long2ip', 'lstat', 'lzf_compress', 'lzf_decompress', @@ -527,6 +517,7 @@ 'md5_file', 'mime_content_type', 'mkdir', + 'mktime', 'msg_get_queue', 'msg_queue_exists', 'msg_receive', @@ -676,6 +667,7 @@ 'openssl_pkey_derive', 'openssl_pkey_export', 'openssl_pkey_export_to_file', + 'openssl_pkey_get_details', 'openssl_pkey_get_private', 'openssl_pkey_get_public', 'openssl_pkey_new', @@ -697,7 +689,6 @@ 'openssl_x509_read', 'output_add_rewrite_var', 'output_reset_rewrite_vars', - 'pack', 'parse_ini_file', 'parse_ini_string', 'parse_url', @@ -959,7 +950,6 @@ 'shm_put_var', 'shm_remove', 'shm_remove_var', - 'shuffle', 'simplexml_import_dom', 'simplexml_load_file', 'simplexml_load_string', diff --git a/generated/8.2/info.php b/generated/8.2/info.php index a227ae67..ecc445f9 100644 --- a/generated/8.2/info.php +++ b/generated/8.2/info.php @@ -417,12 +417,12 @@ function ini_get(string $option): string * @param string $option Not all the available options can be changed using * ini_set. There is a list of all available options * in the appendix. - * @param string $value The new value for the option. + * @param bool|float|int|null|string $value The new value for the option. * @return string Returns the old value on success. * @throws InfoException * */ -function ini_set(string $option, string $value): string +function ini_set(string $option, $value): string { error_clear_last(); $safeResult = \ini_set($option, $value); diff --git a/generated/8.2/openssl.php b/generated/8.2/openssl.php index 24130297..776b9669 100644 --- a/generated/8.2/openssl.php +++ b/generated/8.2/openssl.php @@ -968,6 +968,35 @@ function openssl_pkey_export($key, ?string &$output, ?string $passphrase = null, } +/** + * This function returns the key details (bits, key, type). + * + * @param \OpenSSLAsymmetricKey $key Resource holding the key. + * @return array Returns an array with the key details in success or FALSE in failure. + * Returned array has indexes bits (number of bits), + * key (string representation of the public key) and + * type (type of the key which is one of + * OPENSSL_KEYTYPE_RSA, + * OPENSSL_KEYTYPE_DSA, + * OPENSSL_KEYTYPE_DH, + * OPENSSL_KEYTYPE_EC or -1 meaning unknown). + * + * Depending on the key type used, additional details may be returned. Note that + * some elements may not always be available. + * @throws OpensslException + * + */ +function openssl_pkey_get_details(\OpenSSLAsymmetricKey $key): array +{ + error_clear_last(); + $safeResult = \openssl_pkey_get_details($key); + if ($safeResult === false) { + throw OpensslException::createFromPhpError(); + } + return $safeResult; +} + + /** * openssl_pkey_get_private parses * private_key and prepares it for use by other functions. @@ -1191,10 +1220,10 @@ function openssl_public_encrypt(string $data, ?string &$encrypted_data, $public_ * @param bool|null $strong_result If passed into the function, this will hold a bool value that determines * if the algorithm used was "cryptographically strong", e.g., safe for usage with GPG, * passwords, etc. TRUE if it did, otherwise FALSE - * @return false|string Returns the generated string of bytes. + * @return string Returns the generated string of bytes. * */ -function openssl_random_pseudo_bytes(int $length, ?bool &$strong_result = null) +function openssl_random_pseudo_bytes(int $length, ?bool &$strong_result = null): string { error_clear_last(); $safeResult = \openssl_random_pseudo_bytes($length, $strong_result); diff --git a/generated/8.2/rector-migrate.php b/generated/8.2/rector-migrate.php index 225f82d1..da4eae51 100644 --- a/generated/8.2/rector-migrate.php +++ b/generated/8.2/rector-migrate.php @@ -12,8 +12,6 @@ [ 'apache_getenv' => 'Safe\apache_getenv', 'apache_get_version' => 'Safe\apache_get_version', 'apache_lookup_uri' => 'Safe\apache_lookup_uri', - 'apache_request_headers' => 'Safe\apache_request_headers', - 'apache_response_headers' => 'Safe\apache_response_headers', 'apache_setenv' => 'Safe\apache_setenv', 'apcu_cache_info' => 'Safe\apcu_cache_info', 'apcu_cas' => 'Safe\apcu_cas', @@ -21,7 +19,6 @@ 'apcu_fetch' => 'Safe\apcu_fetch', 'apcu_inc' => 'Safe\apcu_inc', 'apcu_sma_info' => 'Safe\apcu_sma_info', - 'array_walk_recursive' => 'Safe\array_walk_recursive', 'assert_options' => 'Safe\assert_options', 'base64_decode' => 'Safe\base64_decode', 'bindtextdomain' => 'Safe\bindtextdomain', @@ -110,16 +107,13 @@ 'curl_multi_init' => 'Safe\curl_multi_init', 'curl_multi_setopt' => 'Safe\curl_multi_setopt', 'curl_setopt' => 'Safe\curl_setopt', - 'curl_share_errno' => 'Safe\curl_share_errno', 'curl_share_setopt' => 'Safe\curl_share_setopt', 'curl_unescape' => 'Safe\curl_unescape', 'curl_upkeep' => 'Safe\curl_upkeep', - 'date' => 'Safe\date', - 'date_parse' => 'Safe\date_parse', + 'date_create' => 'Safe\date_create', 'date_parse_from_format' => 'Safe\date_parse_from_format', 'date_sunrise' => 'Safe\date_sunrise', 'date_sunset' => 'Safe\date_sunset', - 'date_sun_info' => 'Safe\date_sun_info', 'db2_autocommit' => 'Safe\db2_autocommit', 'db2_bind_param' => 'Safe\db2_bind_param', 'db2_client_info' => 'Safe\db2_client_info', @@ -239,7 +233,6 @@ 'ftp_systype' => 'Safe\ftp_systype', 'ftruncate' => 'Safe\ftruncate', 'fwrite' => 'Safe\fwrite', - 'getallheaders' => 'Safe\getallheaders', 'getcwd' => 'Safe\getcwd', 'gethostname' => 'Safe\gethostname', 'getimagesize' => 'Safe\getimagesize', @@ -395,8 +388,6 @@ 'imagesettile' => 'Safe\imagesettile', 'imagestring' => 'Safe\imagestring', 'imagestringup' => 'Safe\imagestringup', - 'imagesx' => 'Safe\imagesx', - 'imagesy' => 'Safe\imagesy', 'imagetruecolortopalette' => 'Safe\imagetruecolortopalette', 'imagettfbbox' => 'Safe\imagettfbbox', 'imagettftext' => 'Safe\imagettftext', @@ -503,7 +494,6 @@ 'ldap_unbind' => 'Safe\ldap_unbind', 'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader', 'link' => 'Safe\link', - 'long2ip' => 'Safe\long2ip', 'lstat' => 'Safe\lstat', 'lzf_compress' => 'Safe\lzf_compress', 'lzf_decompress' => 'Safe\lzf_decompress', @@ -535,6 +525,7 @@ 'md5_file' => 'Safe\md5_file', 'mime_content_type' => 'Safe\mime_content_type', 'mkdir' => 'Safe\mkdir', + 'mktime' => 'Safe\mktime', 'msg_get_queue' => 'Safe\msg_get_queue', 'msg_queue_exists' => 'Safe\msg_queue_exists', 'msg_receive' => 'Safe\msg_receive', @@ -684,6 +675,7 @@ 'openssl_pkey_derive' => 'Safe\openssl_pkey_derive', 'openssl_pkey_export' => 'Safe\openssl_pkey_export', 'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file', + 'openssl_pkey_get_details' => 'Safe\openssl_pkey_get_details', 'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private', 'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public', 'openssl_pkey_new' => 'Safe\openssl_pkey_new', @@ -705,7 +697,6 @@ 'openssl_x509_read' => 'Safe\openssl_x509_read', 'output_add_rewrite_var' => 'Safe\output_add_rewrite_var', 'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars', - 'pack' => 'Safe\pack', 'parse_ini_file' => 'Safe\parse_ini_file', 'parse_ini_string' => 'Safe\parse_ini_string', 'parse_url' => 'Safe\parse_url', @@ -967,7 +958,6 @@ 'shm_put_var' => 'Safe\shm_put_var', 'shm_remove' => 'Safe\shm_remove', 'shm_remove_var' => 'Safe\shm_remove_var', - 'shuffle' => 'Safe\shuffle', 'simplexml_import_dom' => 'Safe\simplexml_import_dom', 'simplexml_load_file' => 'Safe\simplexml_load_file', 'simplexml_load_string' => 'Safe\simplexml_load_string', diff --git a/generated/8.3/datetime.php b/generated/8.3/datetime.php index c3fa9585..b4f26c55 100644 --- a/generated/8.3/datetime.php +++ b/generated/8.3/datetime.php @@ -4,6 +4,36 @@ use Safe\Exceptions\DatetimeException; +/** + * This is the procedural version of + * DateTime::__construct. + * + * Unlike the DateTime constructor, it will return + * FALSE instead of an exception if the passed in + * datetime string is invalid. + * + * @param null|string $datetime + * @param \DateTimeZone|null $timezone + * @return \DateTime Returns a new DateTime instance. + * Procedural style returns FALSE on failure. + * @throws DatetimeException + * + */ +function date_create(?string $datetime = "now", ?\DateTimeZone $timezone = null): \DateTime +{ + error_clear_last(); + if ($timezone !== null) { + $safeResult = \date_create($datetime, $timezone); + } else { + $safeResult = \date_create($datetime); + } + if ($safeResult === false) { + throw DatetimeException::createFromPhpError(); + } + return $safeResult; +} + + /** * Returns associative array with detailed info about given date/time. * @@ -730,11 +760,12 @@ function idate(string $format, ?int $timestamp = null): int * 1970-2000. On systems where time_t is a 32bit signed integer, as * most common today, the valid range for year * is somewhere between 1901 and 2038. - * @return false|int mktime returns the Unix timestamp of the arguments + * @return int mktime returns the Unix timestamp of the arguments * given. + * @throws DatetimeException * */ -function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null) +function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int { error_clear_last(); if ($year !== null) { @@ -750,6 +781,9 @@ function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month } else { $safeResult = \mktime($hour); } + if ($safeResult === false) { + throw DatetimeException::createFromPhpError(); + } return $safeResult; } diff --git a/generated/8.3/functionsList.php b/generated/8.3/functionsList.php index ee336c6c..bb161c46 100644 --- a/generated/8.3/functionsList.php +++ b/generated/8.3/functionsList.php @@ -4,8 +4,6 @@ 'apache_getenv', 'apache_get_version', 'apache_lookup_uri', - 'apache_request_headers', - 'apache_response_headers', 'apache_setenv', 'apcu_cache_info', 'apcu_cas', @@ -13,7 +11,6 @@ 'apcu_fetch', 'apcu_inc', 'apcu_sma_info', - 'array_walk_recursive', 'assert_options', 'base64_decode', 'bindtextdomain', @@ -102,16 +99,13 @@ 'curl_multi_init', 'curl_multi_setopt', 'curl_setopt', - 'curl_share_errno', 'curl_share_setopt', 'curl_unescape', 'curl_upkeep', - 'date', - 'date_parse', + 'date_create', 'date_parse_from_format', 'date_sunrise', 'date_sunset', - 'date_sun_info', 'db2_autocommit', 'db2_bind_param', 'db2_client_info', @@ -231,7 +225,6 @@ 'ftp_systype', 'ftruncate', 'fwrite', - 'getallheaders', 'getcwd', 'gethostname', 'getimagesize', @@ -387,8 +380,6 @@ 'imagesettile', 'imagestring', 'imagestringup', - 'imagesx', - 'imagesy', 'imagetruecolortopalette', 'imagettfbbox', 'imagettftext', @@ -495,7 +486,6 @@ 'ldap_unbind', 'libxml_set_external_entity_loader', 'link', - 'long2ip', 'lstat', 'lzf_compress', 'lzf_decompress', @@ -527,6 +517,7 @@ 'md5_file', 'mime_content_type', 'mkdir', + 'mktime', 'msg_get_queue', 'msg_queue_exists', 'msg_receive', @@ -676,6 +667,7 @@ 'openssl_pkey_derive', 'openssl_pkey_export', 'openssl_pkey_export_to_file', + 'openssl_pkey_get_details', 'openssl_pkey_get_private', 'openssl_pkey_get_public', 'openssl_pkey_new', @@ -697,7 +689,6 @@ 'openssl_x509_read', 'output_add_rewrite_var', 'output_reset_rewrite_vars', - 'pack', 'parse_ini_file', 'parse_ini_string', 'parse_url', @@ -959,7 +950,6 @@ 'shm_put_var', 'shm_remove', 'shm_remove_var', - 'shuffle', 'simplexml_import_dom', 'simplexml_load_file', 'simplexml_load_string', diff --git a/generated/8.3/info.php b/generated/8.3/info.php index a227ae67..ecc445f9 100644 --- a/generated/8.3/info.php +++ b/generated/8.3/info.php @@ -417,12 +417,12 @@ function ini_get(string $option): string * @param string $option Not all the available options can be changed using * ini_set. There is a list of all available options * in the appendix. - * @param string $value The new value for the option. + * @param bool|float|int|null|string $value The new value for the option. * @return string Returns the old value on success. * @throws InfoException * */ -function ini_set(string $option, string $value): string +function ini_set(string $option, $value): string { error_clear_last(); $safeResult = \ini_set($option, $value); diff --git a/generated/8.3/openssl.php b/generated/8.3/openssl.php index 24130297..776b9669 100644 --- a/generated/8.3/openssl.php +++ b/generated/8.3/openssl.php @@ -968,6 +968,35 @@ function openssl_pkey_export($key, ?string &$output, ?string $passphrase = null, } +/** + * This function returns the key details (bits, key, type). + * + * @param \OpenSSLAsymmetricKey $key Resource holding the key. + * @return array Returns an array with the key details in success or FALSE in failure. + * Returned array has indexes bits (number of bits), + * key (string representation of the public key) and + * type (type of the key which is one of + * OPENSSL_KEYTYPE_RSA, + * OPENSSL_KEYTYPE_DSA, + * OPENSSL_KEYTYPE_DH, + * OPENSSL_KEYTYPE_EC or -1 meaning unknown). + * + * Depending on the key type used, additional details may be returned. Note that + * some elements may not always be available. + * @throws OpensslException + * + */ +function openssl_pkey_get_details(\OpenSSLAsymmetricKey $key): array +{ + error_clear_last(); + $safeResult = \openssl_pkey_get_details($key); + if ($safeResult === false) { + throw OpensslException::createFromPhpError(); + } + return $safeResult; +} + + /** * openssl_pkey_get_private parses * private_key and prepares it for use by other functions. @@ -1191,10 +1220,10 @@ function openssl_public_encrypt(string $data, ?string &$encrypted_data, $public_ * @param bool|null $strong_result If passed into the function, this will hold a bool value that determines * if the algorithm used was "cryptographically strong", e.g., safe for usage with GPG, * passwords, etc. TRUE if it did, otherwise FALSE - * @return false|string Returns the generated string of bytes. + * @return string Returns the generated string of bytes. * */ -function openssl_random_pseudo_bytes(int $length, ?bool &$strong_result = null) +function openssl_random_pseudo_bytes(int $length, ?bool &$strong_result = null): string { error_clear_last(); $safeResult = \openssl_random_pseudo_bytes($length, $strong_result); diff --git a/generated/8.3/rector-migrate.php b/generated/8.3/rector-migrate.php index 225f82d1..da4eae51 100644 --- a/generated/8.3/rector-migrate.php +++ b/generated/8.3/rector-migrate.php @@ -12,8 +12,6 @@ [ 'apache_getenv' => 'Safe\apache_getenv', 'apache_get_version' => 'Safe\apache_get_version', 'apache_lookup_uri' => 'Safe\apache_lookup_uri', - 'apache_request_headers' => 'Safe\apache_request_headers', - 'apache_response_headers' => 'Safe\apache_response_headers', 'apache_setenv' => 'Safe\apache_setenv', 'apcu_cache_info' => 'Safe\apcu_cache_info', 'apcu_cas' => 'Safe\apcu_cas', @@ -21,7 +19,6 @@ 'apcu_fetch' => 'Safe\apcu_fetch', 'apcu_inc' => 'Safe\apcu_inc', 'apcu_sma_info' => 'Safe\apcu_sma_info', - 'array_walk_recursive' => 'Safe\array_walk_recursive', 'assert_options' => 'Safe\assert_options', 'base64_decode' => 'Safe\base64_decode', 'bindtextdomain' => 'Safe\bindtextdomain', @@ -110,16 +107,13 @@ 'curl_multi_init' => 'Safe\curl_multi_init', 'curl_multi_setopt' => 'Safe\curl_multi_setopt', 'curl_setopt' => 'Safe\curl_setopt', - 'curl_share_errno' => 'Safe\curl_share_errno', 'curl_share_setopt' => 'Safe\curl_share_setopt', 'curl_unescape' => 'Safe\curl_unescape', 'curl_upkeep' => 'Safe\curl_upkeep', - 'date' => 'Safe\date', - 'date_parse' => 'Safe\date_parse', + 'date_create' => 'Safe\date_create', 'date_parse_from_format' => 'Safe\date_parse_from_format', 'date_sunrise' => 'Safe\date_sunrise', 'date_sunset' => 'Safe\date_sunset', - 'date_sun_info' => 'Safe\date_sun_info', 'db2_autocommit' => 'Safe\db2_autocommit', 'db2_bind_param' => 'Safe\db2_bind_param', 'db2_client_info' => 'Safe\db2_client_info', @@ -239,7 +233,6 @@ 'ftp_systype' => 'Safe\ftp_systype', 'ftruncate' => 'Safe\ftruncate', 'fwrite' => 'Safe\fwrite', - 'getallheaders' => 'Safe\getallheaders', 'getcwd' => 'Safe\getcwd', 'gethostname' => 'Safe\gethostname', 'getimagesize' => 'Safe\getimagesize', @@ -395,8 +388,6 @@ 'imagesettile' => 'Safe\imagesettile', 'imagestring' => 'Safe\imagestring', 'imagestringup' => 'Safe\imagestringup', - 'imagesx' => 'Safe\imagesx', - 'imagesy' => 'Safe\imagesy', 'imagetruecolortopalette' => 'Safe\imagetruecolortopalette', 'imagettfbbox' => 'Safe\imagettfbbox', 'imagettftext' => 'Safe\imagettftext', @@ -503,7 +494,6 @@ 'ldap_unbind' => 'Safe\ldap_unbind', 'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader', 'link' => 'Safe\link', - 'long2ip' => 'Safe\long2ip', 'lstat' => 'Safe\lstat', 'lzf_compress' => 'Safe\lzf_compress', 'lzf_decompress' => 'Safe\lzf_decompress', @@ -535,6 +525,7 @@ 'md5_file' => 'Safe\md5_file', 'mime_content_type' => 'Safe\mime_content_type', 'mkdir' => 'Safe\mkdir', + 'mktime' => 'Safe\mktime', 'msg_get_queue' => 'Safe\msg_get_queue', 'msg_queue_exists' => 'Safe\msg_queue_exists', 'msg_receive' => 'Safe\msg_receive', @@ -684,6 +675,7 @@ 'openssl_pkey_derive' => 'Safe\openssl_pkey_derive', 'openssl_pkey_export' => 'Safe\openssl_pkey_export', 'openssl_pkey_export_to_file' => 'Safe\openssl_pkey_export_to_file', + 'openssl_pkey_get_details' => 'Safe\openssl_pkey_get_details', 'openssl_pkey_get_private' => 'Safe\openssl_pkey_get_private', 'openssl_pkey_get_public' => 'Safe\openssl_pkey_get_public', 'openssl_pkey_new' => 'Safe\openssl_pkey_new', @@ -705,7 +697,6 @@ 'openssl_x509_read' => 'Safe\openssl_x509_read', 'output_add_rewrite_var' => 'Safe\output_add_rewrite_var', 'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars', - 'pack' => 'Safe\pack', 'parse_ini_file' => 'Safe\parse_ini_file', 'parse_ini_string' => 'Safe\parse_ini_string', 'parse_url' => 'Safe\parse_url', @@ -967,7 +958,6 @@ 'shm_put_var' => 'Safe\shm_put_var', 'shm_remove' => 'Safe\shm_remove', 'shm_remove_var' => 'Safe\shm_remove_var', - 'shuffle' => 'Safe\shuffle', 'simplexml_import_dom' => 'Safe\simplexml_import_dom', 'simplexml_load_file' => 'Safe\simplexml_load_file', 'simplexml_load_string' => 'Safe\simplexml_load_string', diff --git a/generated/8.4/datetime.php b/generated/8.4/datetime.php index dcc815cc..9a3e6f8d 100644 --- a/generated/8.4/datetime.php +++ b/generated/8.4/datetime.php @@ -545,11 +545,12 @@ function date(string $format, ?int $timestamp = null): string * Values less than 1 (including negative values) reference the days in the previous month, so 0 is the last day of the previous month, -1 is the day before that, etc. * Values greater than the number of days in the relevant month reference the appropriate day in the following month(s). * @param int|null $year The year - * @return false|int Returns a int Unix timestamp on success, or FALSE if the + * @return int Returns a int Unix timestamp on success, or FALSE if the * timestamp doesn't fit in a PHP integer. + * @throws DatetimeException * */ -function gmmktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null) +function gmmktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int { error_clear_last(); if ($year !== null) { @@ -565,6 +566,9 @@ function gmmktime(int $hour, ?int $minute = null, ?int $second = null, ?int $mon } else { $safeResult = \gmmktime($hour); } + if ($safeResult === false) { + throw DatetimeException::createFromPhpError(); + } return $safeResult; } @@ -769,11 +773,12 @@ function idate(string $format, ?int $timestamp = null): int * 1970-2000. On systems where time_t is a 32bit signed integer, as * most common today, the valid range for year * is somewhere between 1901 and 2038. - * @return false|int mktime returns the Unix timestamp of the arguments + * @return int mktime returns the Unix timestamp of the arguments * given, or FALSE if the timestamp doesn't fit in a PHP integer. + * @throws DatetimeException * */ -function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null) +function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int { error_clear_last(); if ($year !== null) { @@ -789,6 +794,9 @@ function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month } else { $safeResult = \mktime($hour); } + if ($safeResult === false) { + throw DatetimeException::createFromPhpError(); + } return $safeResult; } diff --git a/generated/8.4/functionsList.php b/generated/8.4/functionsList.php index 5d81d3a4..2b371b9f 100644 --- a/generated/8.4/functionsList.php +++ b/generated/8.4/functionsList.php @@ -243,6 +243,7 @@ 'get_include_path', 'get_meta_tags', 'glob', + 'gmmktime', 'gmstrftime', 'gnupg_adddecryptkey', 'gnupg_addencryptkey', @@ -506,6 +507,7 @@ 'md5_file', 'mime_content_type', 'mkdir', + 'mktime', 'msg_get_queue', 'msg_queue_exists', 'msg_receive', diff --git a/generated/8.4/info.php b/generated/8.4/info.php index 6dbf95c9..9312cdaa 100644 --- a/generated/8.4/info.php +++ b/generated/8.4/info.php @@ -422,12 +422,12 @@ function ini_get(string $option): string * @param string $option Not all the available options can be changed using * ini_set. There is a list of all available options * in the appendix. - * @param string $value The new value for the option. + * @param bool|float|int|null|string $value The new value for the option. * @return string Returns the old value on success. * @throws InfoException * */ -function ini_set(string $option, string $value): string +function ini_set(string $option, $value): string { error_clear_last(); $safeResult = \ini_set($option, $value); diff --git a/generated/8.4/openssl.php b/generated/8.4/openssl.php index 9e8d6159..4e25852f 100644 --- a/generated/8.4/openssl.php +++ b/generated/8.4/openssl.php @@ -1240,10 +1240,10 @@ function openssl_public_encrypt(string $data, ?string &$encrypted_data, $public_ * @param bool|null $strong_result If passed into the function, this will hold a bool value that determines * if the algorithm used was "cryptographically strong", e.g., safe for usage with GPG, * passwords, etc. TRUE if it did, otherwise FALSE - * @return false|string Returns the generated string of bytes. + * @return string Returns the generated string of bytes. * */ -function openssl_random_pseudo_bytes(int $length, ?bool &$strong_result = null) +function openssl_random_pseudo_bytes(int $length, ?bool &$strong_result = null): string { error_clear_last(); $safeResult = \openssl_random_pseudo_bytes($length, $strong_result); diff --git a/generated/8.4/rector-migrate.php b/generated/8.4/rector-migrate.php index 690f9938..c497c581 100644 --- a/generated/8.4/rector-migrate.php +++ b/generated/8.4/rector-migrate.php @@ -251,6 +251,7 @@ 'get_include_path' => 'Safe\get_include_path', 'get_meta_tags' => 'Safe\get_meta_tags', 'glob' => 'Safe\glob', + 'gmmktime' => 'Safe\gmmktime', 'gmstrftime' => 'Safe\gmstrftime', 'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey', 'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey', @@ -514,6 +515,7 @@ 'md5_file' => 'Safe\md5_file', 'mime_content_type' => 'Safe\mime_content_type', 'mkdir' => 'Safe\mkdir', + 'mktime' => 'Safe\mktime', 'msg_get_queue' => 'Safe\msg_get_queue', 'msg_queue_exists' => 'Safe\msg_queue_exists', 'msg_receive' => 'Safe\msg_receive', diff --git a/generated/8.5/datetime.php b/generated/8.5/datetime.php index dcc815cc..9a3e6f8d 100644 --- a/generated/8.5/datetime.php +++ b/generated/8.5/datetime.php @@ -545,11 +545,12 @@ function date(string $format, ?int $timestamp = null): string * Values less than 1 (including negative values) reference the days in the previous month, so 0 is the last day of the previous month, -1 is the day before that, etc. * Values greater than the number of days in the relevant month reference the appropriate day in the following month(s). * @param int|null $year The year - * @return false|int Returns a int Unix timestamp on success, or FALSE if the + * @return int Returns a int Unix timestamp on success, or FALSE if the * timestamp doesn't fit in a PHP integer. + * @throws DatetimeException * */ -function gmmktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null) +function gmmktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int { error_clear_last(); if ($year !== null) { @@ -565,6 +566,9 @@ function gmmktime(int $hour, ?int $minute = null, ?int $second = null, ?int $mon } else { $safeResult = \gmmktime($hour); } + if ($safeResult === false) { + throw DatetimeException::createFromPhpError(); + } return $safeResult; } @@ -769,11 +773,12 @@ function idate(string $format, ?int $timestamp = null): int * 1970-2000. On systems where time_t is a 32bit signed integer, as * most common today, the valid range for year * is somewhere between 1901 and 2038. - * @return false|int mktime returns the Unix timestamp of the arguments + * @return int mktime returns the Unix timestamp of the arguments * given, or FALSE if the timestamp doesn't fit in a PHP integer. + * @throws DatetimeException * */ -function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null) +function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int { error_clear_last(); if ($year !== null) { @@ -789,6 +794,9 @@ function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month } else { $safeResult = \mktime($hour); } + if ($safeResult === false) { + throw DatetimeException::createFromPhpError(); + } return $safeResult; } diff --git a/generated/8.5/filesystem.php b/generated/8.5/filesystem.php index b11e6279..d6b82ae3 100644 --- a/generated/8.5/filesystem.php +++ b/generated/8.5/filesystem.php @@ -1088,6 +1088,13 @@ function fwrite($stream, string $data, ?int $length = null): int * * * + * {a,b,c} - Matches one string from a group of + * strings delimited by a comma when the GLOB_BRACE + * flag is used. + * + * + * + * * \ - Escapes the following character, * except when the GLOB_NOESCAPE flag is used. * diff --git a/generated/8.5/functionsList.php b/generated/8.5/functionsList.php index 974fa412..5b38e8b5 100644 --- a/generated/8.5/functionsList.php +++ b/generated/8.5/functionsList.php @@ -243,6 +243,7 @@ 'get_include_path', 'get_meta_tags', 'glob', + 'gmmktime', 'gmstrftime', 'gnupg_adddecryptkey', 'gnupg_addencryptkey', @@ -506,6 +507,7 @@ 'md5_file', 'mime_content_type', 'mkdir', + 'mktime', 'msg_get_queue', 'msg_queue_exists', 'msg_receive', diff --git a/generated/8.5/image.php b/generated/8.5/image.php index 656249d3..bc6a66ad 100644 --- a/generated/8.5/image.php +++ b/generated/8.5/image.php @@ -270,7 +270,7 @@ function imagearc(\GdImage $image, int $center_x, int $center_y, int $width, int * @param null|resource|string $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. * @param int $quality quality is optional, and ranges from 0 (worst quality, smaller file) * to 100 (best quality, larger file). - * If -1 is provided, the default value 30 is used. + * If -1 is provided, the default value 52 is used. * @param int $speed speed is optional, and ranges from 0 (slow, smaller file) * to 10 (fast, larger file). * If -1 is provided, the default value 6 is used. @@ -2831,6 +2831,7 @@ function imagewbmp(\GdImage $image, $file = null, ?int $foreground_color = null) * @param null|resource|string $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be output directly. * @param int $quality quality ranges from 0 (worst * quality, smaller file) to 100 (best quality, biggest file). + * If -1 is provided, the default value 80 is used. * @throws ImageException * */ diff --git a/generated/8.5/info.php b/generated/8.5/info.php index 6dbf95c9..9312cdaa 100644 --- a/generated/8.5/info.php +++ b/generated/8.5/info.php @@ -422,12 +422,12 @@ function ini_get(string $option): string * @param string $option Not all the available options can be changed using * ini_set. There is a list of all available options * in the appendix. - * @param string $value The new value for the option. + * @param bool|float|int|null|string $value The new value for the option. * @return string Returns the old value on success. * @throws InfoException * */ -function ini_set(string $option, string $value): string +function ini_set(string $option, $value): string { error_clear_last(); $safeResult = \ini_set($option, $value); diff --git a/generated/8.5/openssl.php b/generated/8.5/openssl.php index fde79f43..28b03a5a 100644 --- a/generated/8.5/openssl.php +++ b/generated/8.5/openssl.php @@ -1587,10 +1587,10 @@ function openssl_public_encrypt(string $data, ?string &$encrypted_data, $public_ * @param bool|null $strong_result If passed into the function, this will hold a bool value that determines * if the algorithm used was "cryptographically strong", e.g., safe for usage with GPG, * passwords, etc. TRUE if it did, otherwise FALSE - * @return false|string Returns the generated string of bytes. + * @return string Returns the generated string of bytes. * */ -function openssl_random_pseudo_bytes(int $length, ?bool &$strong_result = null) +function openssl_random_pseudo_bytes(int $length, ?bool &$strong_result = null): string { error_clear_last(); $safeResult = \openssl_random_pseudo_bytes($length, $strong_result); diff --git a/generated/8.5/rector-migrate.php b/generated/8.5/rector-migrate.php index 20a1400d..bf706d06 100644 --- a/generated/8.5/rector-migrate.php +++ b/generated/8.5/rector-migrate.php @@ -251,6 +251,7 @@ 'get_include_path' => 'Safe\get_include_path', 'get_meta_tags' => 'Safe\get_meta_tags', 'glob' => 'Safe\glob', + 'gmmktime' => 'Safe\gmmktime', 'gmstrftime' => 'Safe\gmstrftime', 'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey', 'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey', @@ -514,6 +515,7 @@ 'md5_file' => 'Safe\md5_file', 'mime_content_type' => 'Safe\mime_content_type', 'mkdir' => 'Safe\mkdir', + 'mktime' => 'Safe\mktime', 'msg_get_queue' => 'Safe\msg_get_queue', 'msg_queue_exists' => 'Safe\msg_queue_exists', 'msg_receive' => 'Safe\msg_receive', diff --git a/generator/config/CustomPhpStanFunctionMap.php b/generator/config/CustomPhpStanFunctionMap.php index 9dcb3ef7..afc85a16 100644 --- a/generator/config/CustomPhpStanFunctionMap.php +++ b/generator/config/CustomPhpStanFunctionMap.php @@ -13,8 +13,10 @@ 'sem_get' => ['resource|false', 'key'=>'int', 'max_acquire='=>'int', 'perm='=>'int', 'auto_release='=>'bool'], // auto_release is a bool 'imap_open' => ['resource|false', 'mailbox'=>'string', 'user'=>'string', 'password'=>'string', 'flags='=>'int', 'retries='=>'int', 'options=' => 'array'], //the last 3 parameters were renamed 'imagerotate' => ['resource|false', 'src_im'=>'resource', 'angle'=>'float', 'bgdcolor'=>'int', 'ignoretransparent='=>'bool'], //ignoretransparent is a bool instead of a int - 'get_headers' => ['array|false', 'url'=>'string', 'format='=>'bool', 'context='=>'resource'], // format is a bool instead of int 'imagegrabwindow' => ['GdImage|false', 'handle'=>'int', 'client_area'=>'bool'], // client_area is a bool instead of an int + 'get_headers' => ['array|false', 'url'=>'string', 'format='=>'bool', 'context='=>'resource'], // format is a bool instead of int + 'ini_set' => ['string|false', 'varname'=>'string', 'newvalue'=>'string|int|float|bool|null'], // newvalue can be many types + 'openssl_random_pseudo_bytes' => ['string', 'length'=>'int', '&strong_result='=>'bool'], // theses replace resource by OpenSSLAsymmetricKey 'openssl_pkey_get_private' => ['OpenSSLAsymmetricKey|false', 'private_key'=>'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string', 'passphrase='=>'null|string'], diff --git a/generator/config/detectErrorType.php b/generator/config/detectErrorType.php index 52fc6bdd..2ceef5c2 100644 --- a/generator/config/detectErrorType.php +++ b/generator/config/detectErrorType.php @@ -24,6 +24,7 @@ '/[Tt]he function returns &false;/m', '/&false;\s+on\s+error/m', '/&false;\s+on\s+failure/m', + '/&false;\s+in\s+failure/m', // openssl_pkey_get_details (8.1 - 8.3) '/&false;\s+for\s+failure/m', '/&false;\s+in\s+case\s+of\s+error/m', '/&false;\s+if\s+an\s+error\s+occurred/m', @@ -52,6 +53,10 @@ "/If an error occurs, returns &false;./m", // ftell, popen '/On failure to change the value, &false; is returned./m', // session_cache_expire, session_cache_limiter '/This function returns &true; if a session was successfully started,\s+otherwise &false;./m', // session_start + '/&false;\s+if\s+the\s+timestamp\s+doesn\'t\s+fit\s+in\s+a\s+PHP\s+integer./m', // gmmktime / mktime + '/mktime<\/function>\s+returns\s+the\s+Unix\s+timestamp\s+of\s+the\s+arguments\s+given./', // mktime before https://github.com/php/doc-en/pull/2651 + '/The name of the socket/', // stream_socket_get_name (PHP 8.1) + '/&return.falseforfailure.style.procedural;/', // date_create (8.1 - 8.3) ]; foreach ($falsies as $falsie) { if (preg_match($falsie, $text)) { diff --git a/generator/config/hiddenFunctions.php b/generator/config/hiddenFunctions.php index 3be5b29e..50e0b5ed 100644 --- a/generator/config/hiddenFunctions.php +++ b/generator/config/hiddenFunctions.php @@ -7,7 +7,30 @@ * to suggest that users should be using them. */ return [ + 'apache_request_headers', // always return an array since PHP 7, see https://github.com/php/doc-en/pull/4076 + 'apache_response_headers', // always return an array since PHP 7, see https://github.com/php/doc-en/pull/4076 'array_all', // false is not an error + 'array_combine', // this function throws an error instead of returning false since PHP 8.0 + 'array_flip', // always return an array since PHP 8.0, see https://github.com/php/doc-en/issues/1178 + 'array_replace', // this function throws an error instead of returning false since PHP 8.0, see https://github.com/php/doc-en/pull/1649 + 'array_replace_recursive', // this function throws an error instead of returning false since PHP 8.0, see https://github.com/php/doc-en/pull/1649 + 'array_walk_recursive', // actually returns always true, see https://github.com/php/doc-en/commit/cec5275f23d2db648df30a5702b378044431be97 + 'curl_share_errno', // this function does not anymore return false since PHP 8.0 + 'date', // this function throws an error instead of returning false PHP 8.0, but the doc has only been updated since PHP 8.4 + 'date_parse', // always return an array, see https://github.com/php/doc-en/pull/2395 + 'date_sun_info', // always return an array since PHP 8.0, https://github.com/php/doc-en/pull/3207 + 'getallheaders', // always return an array since PHP 7, see https://github.com/php/doc-en/commit/68e52ef14de33f6752a8fdda1ae83c861c5babdb + 'gmp_random_seed', // this function throws an error instead of returning false since PHP 8.0 + 'hash_hkdf', // this function throws an error instead of returning false since PHP 8.0 + 'imagecolorsforindex', // this function throws an error instead of returning false since PHP 8.0 + 'long2ip', // false return type cannot actually be returned, see https://github.com/php/php-src/pull/13395 + 'mysqli_get_client_stats', // false is actually never returned, see https://github.com/php/doc-en/pull/1055 + 'openssl_random_pseudo_bytes', // this function throws an error instead of returning false since PHP 7.4 + 'pack', // this function no longer returns false since PHP 8.0, but the doc has only been updated since PHP 8.4 + 'imagesx', // this function throws an error instead of returning false PHP 8.0, see https://github.com/php/doc-en/commit/0462f49fb00dd5abaec3aa322009f2eb40a3279d + 'imagesy', // this function throws an error instead of returning false PHP 8.0, see https://github.com/php/doc-en/commit/37f858a5579386dafaddaffbe15034dbcd0f55c8 + 'shuffle', // actually returns always true 'sodium_crypto_auth_verify', // boolean return value is expected from verify 'sodium_crypto_sign_verify_detached', // boolean return value is expected from verify + 'sleep', // this function throws an error instead of returning false since PHP 8.0 ];