mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Merge pull request #8228 from othercorey/callmap-nullable
Fix nullable return types for CallMap functions
This commit is contained in:
commit
4fbbf820d8
@ -1066,7 +1066,7 @@ return [
|
||||
'classObj::settext' => ['int', 'text'=>'string'],
|
||||
'classObj::updateFromString' => ['int', 'snippet'=>'string'],
|
||||
'clearstatcache' => ['void', 'clear_realpath_cache='=>'bool', 'filename='=>'string'],
|
||||
'cli_get_process_title' => ['string'],
|
||||
'cli_get_process_title' => ['?string'],
|
||||
'cli_set_process_title' => ['bool', 'title'=>'string'],
|
||||
'ClosedGeneratorException::__clone' => ['void'],
|
||||
'ClosedGeneratorException::__toString' => ['string'],
|
||||
@ -1106,7 +1106,7 @@ return [
|
||||
'Collator::sortWithSortKeys' => ['bool', '&rw_arr'=>'array'],
|
||||
'collator_asort' => ['bool', 'object'=>'collator', '&rw_array'=>'array', 'flags='=>'int'],
|
||||
'collator_compare' => ['int', 'object'=>'collator', 'string1'=>'string', 'string2'=>'string'],
|
||||
'collator_create' => ['Collator', 'locale'=>'string'],
|
||||
'collator_create' => ['?Collator', 'locale'=>'string'],
|
||||
'collator_get_attribute' => ['int|false', 'object'=>'collator', 'attribute'=>'int'],
|
||||
'collator_get_error_code' => ['int', 'object'=>'collator'],
|
||||
'collator_get_error_message' => ['string', 'object'=>'collator'],
|
||||
@ -1678,7 +1678,7 @@ return [
|
||||
'curl_multi_close' => ['void', 'multi_handle'=>'CurlMultiHandle'],
|
||||
'curl_multi_errno' => ['int', 'multi_handle'=>'CurlMultiHandle'],
|
||||
'curl_multi_exec' => ['int', 'multi_handle'=>'CurlMultiHandle', '&w_still_running'=>'int'],
|
||||
'curl_multi_getcontent' => ['string', 'handle'=>'CurlHandle'],
|
||||
'curl_multi_getcontent' => ['?string', 'handle'=>'CurlHandle'],
|
||||
'curl_multi_info_read' => ['array|false', 'multi_handle'=>'CurlMultiHandle', '&w_queued_messages='=>'int'],
|
||||
'curl_multi_init' => ['CurlMultiHandle|false'],
|
||||
'curl_multi_remove_handle' => ['int', 'multi_handle'=>'CurlMultiHandle', 'handle'=>'CurlHandle'],
|
||||
@ -1744,7 +1744,7 @@ return [
|
||||
'datefmt_format' => ['string|false', 'formatter'=>'IntlDateFormatter', 'datetime'=>'DateTime|IntlCalendar|array|int'],
|
||||
'datefmt_format_object' => ['string|false', 'datetime'=>'object', 'format='=>'mixed', 'locale='=>'string'],
|
||||
'datefmt_get_calendar' => ['int', 'formatter'=>'IntlDateFormatter'],
|
||||
'datefmt_get_calendar_object' => ['IntlCalendar', 'formatter'=>'IntlDateFormatter'],
|
||||
'datefmt_get_calendar_object' => ['IntlCalendar|false|null', 'formatter'=>'IntlDateFormatter'],
|
||||
'datefmt_get_datetype' => ['int', 'formatter'=>'IntlDateFormatter'],
|
||||
'datefmt_get_error_code' => ['int', 'formatter'=>'IntlDateFormatter'],
|
||||
'datefmt_get_error_message' => ['string', 'formatter'=>'IntlDateFormatter'],
|
||||
@ -3362,7 +3362,7 @@ return [
|
||||
'ftp_put' => ['bool', 'ftp'=>'FTP\Connection', 'remote_filename'=>'string', 'local_filename'=>'string', 'mode='=>'int', 'offset='=>'int'],
|
||||
'ftp_pwd' => ['string|false', 'ftp'=>'FTP\Connection'],
|
||||
'ftp_quit' => ['bool', 'ftp'=>'FTP\Connection'],
|
||||
'ftp_raw' => ['array', 'ftp'=>'FTP\Connection', 'command'=>'string'],
|
||||
'ftp_raw' => ['?array', 'ftp'=>'FTP\Connection', 'command'=>'string'],
|
||||
'ftp_rawlist' => ['array|false', 'ftp'=>'FTP\Connection', 'directory'=>'string', 'recursive='=>'bool'],
|
||||
'ftp_rename' => ['bool', 'ftp'=>'FTP\Connection', 'from'=>'string', 'to'=>'string'],
|
||||
'ftp_rmdir' => ['bool', 'ftp'=>'FTP\Connection', 'directory'=>'string'],
|
||||
@ -6190,7 +6190,7 @@ return [
|
||||
'intlcal_after' => ['bool', 'calendar'=>'IntlCalendar', 'other'=>'IntlCalendar'],
|
||||
'intlcal_before' => ['bool', 'calendar'=>'IntlCalendar', 'other'=>'IntlCalendar'],
|
||||
'intlcal_clear' => ['bool', 'calendar'=>'IntlCalendar', 'field='=>'int'],
|
||||
'intlcal_create_instance' => ['IntlCalendar', 'timezone='=>'mixed', 'locale='=>'string'],
|
||||
'intlcal_create_instance' => ['?IntlCalendar', 'timezone='=>'mixed', 'locale='=>'string'],
|
||||
'intlcal_equals' => ['bool', 'calendar'=>'IntlCalendar', 'other'=>'IntlCalendar'],
|
||||
'intlcal_field_difference' => ['int', 'calendar'=>'IntlCalendar', 'timestamp'=>'float', 'field'=>'int'],
|
||||
'intlcal_from_date_time' => ['IntlCalendar', 'datetime'=>'DateTime|string'],
|
||||
@ -6503,8 +6503,8 @@ return [
|
||||
'IntlTimeZone::useDaylightTime' => ['bool'],
|
||||
'intltz_count_equivalent_ids' => ['int', 'timezoneId'=>'string'],
|
||||
'intltz_create_enumeration' => ['IntlIterator', 'countryOrRawOffset'=>'mixed'],
|
||||
'intltz_create_time_zone' => ['IntlTimeZone', 'timezoneId'=>'string'],
|
||||
'intltz_from_date_time_zone' => ['IntlTimeZone', 'timezone'=>'DateTimeZone'],
|
||||
'intltz_create_time_zone' => ['?IntlTimeZone', 'timezoneId'=>'string'],
|
||||
'intltz_from_date_time_zone' => ['?IntlTimeZone', 'timezone'=>'DateTimeZone'],
|
||||
'intltz_get_canonical_id' => ['string', 'timezoneId'=>'string', '&isSystemId'=>'bool'],
|
||||
'intltz_get_display_name' => ['string', 'timezone'=>'IntlTimeZone', 'dst'=>'bool', 'style'=>'int', 'locale'=>'string'],
|
||||
'intltz_get_dst_savings' => ['int', 'timezone'=>'IntlTimeZone'],
|
||||
@ -6923,22 +6923,22 @@ return [
|
||||
'Locale::parseLocale' => ['array', 'locale'=>'string'],
|
||||
'Locale::setDefault' => ['bool', 'locale'=>'string'],
|
||||
'locale_accept_from_http' => ['string|false', 'header'=>'string'],
|
||||
'locale_canonicalize' => ['string', 'locale'=>'string'],
|
||||
'locale_canonicalize' => ['?string', 'locale'=>'string'],
|
||||
'locale_compose' => ['string|false', 'subtags'=>'array'],
|
||||
'locale_filter_matches' => ['bool', 'languageTag'=>'string', 'locale'=>'string', 'canonicalize='=>'bool'],
|
||||
'locale_get_all_variants' => ['array', 'locale'=>'string'],
|
||||
'locale_filter_matches' => ['?bool', 'languageTag'=>'string', 'locale'=>'string', 'canonicalize='=>'bool'],
|
||||
'locale_get_all_variants' => ['?array', 'locale'=>'string'],
|
||||
'locale_get_default' => ['string'],
|
||||
'locale_get_display_language' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
|
||||
'locale_get_display_name' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
|
||||
'locale_get_display_region' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
|
||||
'locale_get_display_script' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
|
||||
'locale_get_display_variant' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
|
||||
'locale_get_keywords' => ['array|false', 'locale'=>'string'],
|
||||
'locale_get_primary_language' => ['string', 'locale'=>'string'],
|
||||
'locale_get_region' => ['string', 'locale'=>'string'],
|
||||
'locale_get_script' => ['string', 'locale'=>'string'],
|
||||
'locale_lookup' => ['string', 'languageTag'=>'array', 'locale'=>'string', 'canonicalize='=>'bool', 'defaultLocale='=>'string'],
|
||||
'locale_parse' => ['array', 'locale'=>'string'],
|
||||
'locale_get_keywords' => ['array|false|null', 'locale'=>'string'],
|
||||
'locale_get_primary_language' => ['?string', 'locale'=>'string'],
|
||||
'locale_get_region' => ['?string', 'locale'=>'string'],
|
||||
'locale_get_script' => ['?string', 'locale'=>'string'],
|
||||
'locale_lookup' => ['?string', 'languageTag'=>'array', 'locale'=>'string', 'canonicalize='=>'bool', 'defaultLocale='=>'string'],
|
||||
'locale_parse' => ['?array', 'locale'=>'string'],
|
||||
'locale_set_default' => ['bool', 'locale'=>'string'],
|
||||
'localeconv' => ['array'],
|
||||
'localtime' => ['array', 'timestamp='=>'int', 'associative='=>'bool'],
|
||||
@ -7279,7 +7279,7 @@ return [
|
||||
'mb_ereg' => ['bool', 'pattern'=>'string', 'string'=>'string', '&w_matches='=>'array|null'],
|
||||
'mb_ereg_match' => ['bool', 'pattern'=>'string', 'string'=>'string', 'options='=>'string|null'],
|
||||
'mb_ereg_replace' => ['string|false|null', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string', 'options='=>'string|null'],
|
||||
'mb_ereg_replace_callback' => ['string|false', 'pattern'=>'string', 'callback'=>'callable', 'string'=>'string', 'options='=>'string|null'],
|
||||
'mb_ereg_replace_callback' => ['string|false|null', 'pattern'=>'string', 'callback'=>'callable', 'string'=>'string', 'options='=>'string|null'],
|
||||
'mb_ereg_search' => ['bool', 'pattern='=>'string|null', 'options='=>'string|null'],
|
||||
'mb_ereg_search_getpos' => ['int'],
|
||||
'mb_ereg_search_getregs' => ['string[]|false'],
|
||||
@ -8167,7 +8167,7 @@ return [
|
||||
'msg_send' => ['bool', 'queue'=>'resource', 'message_type'=>'int', 'message'=>'mixed', 'serialize='=>'bool', 'blocking='=>'bool', '&w_error_code='=>'int'],
|
||||
'msg_set_queue' => ['bool', 'queue'=>'resource', 'data'=>'array'],
|
||||
'msg_stat_queue' => ['array', 'queue'=>'resource'],
|
||||
'msgfmt_create' => ['MessageFormatter', 'locale'=>'string', 'pattern'=>'string'],
|
||||
'msgfmt_create' => ['?MessageFormatter', 'locale'=>'string', 'pattern'=>'string'],
|
||||
'msgfmt_format' => ['string|false', 'formatter'=>'MessageFormatter', 'values'=>'array'],
|
||||
'msgfmt_format_message' => ['string|false', 'locale'=>'string', 'pattern'=>'string', 'values'=>'array'],
|
||||
'msgfmt_get_error_code' => ['int', 'formatter'=>'MessageFormatter'],
|
||||
@ -8481,7 +8481,7 @@ return [
|
||||
'mysqli_field_tell' => ['int', 'result'=>'mysqli_result'],
|
||||
'mysqli_free_result' => ['void', 'result'=>'mysqli_result'],
|
||||
'mysqli_get_cache_stats' => ['array|false'],
|
||||
'mysqli_get_charset' => ['object', 'mysql'=>'mysqli'],
|
||||
'mysqli_get_charset' => ['?object', 'mysql'=>'mysqli'],
|
||||
'mysqli_get_client_info' => ['string', 'mysql='=>'?mysqli'],
|
||||
'mysqli_get_client_stats' => ['array'],
|
||||
'mysqli_get_client_version' => ['int', 'link'=>'mysqli'],
|
||||
@ -11783,7 +11783,7 @@ return [
|
||||
'SAMConnection::unsubscribe' => ['bool', 'subscriptionid'=>'string', 'targettopic='=>'string'],
|
||||
'SAMMessage::body' => ['string'],
|
||||
'SAMMessage::header' => ['object'],
|
||||
'sapi_windows_cp_conv' => ['string', 'in_codepage'=>'int|string', 'out_codepage'=>'int|string', 'subject'=>'string'],
|
||||
'sapi_windows_cp_conv' => ['?string', 'in_codepage'=>'int|string', 'out_codepage'=>'int|string', 'subject'=>'string'],
|
||||
'sapi_windows_cp_get' => ['int'],
|
||||
'sapi_windows_cp_is_utf8' => ['bool'],
|
||||
'sapi_windows_cp_set' => ['bool', 'codepage'=>'int'],
|
||||
@ -13786,7 +13786,7 @@ return [
|
||||
'strcoll' => ['int', 'string1'=>'string', 'string2'=>'string'],
|
||||
'strcspn' => ['int', 'string'=>'string', 'characters'=>'string', 'offset='=>'int', 'length='=>'int'],
|
||||
'stream_bucket_append' => ['void', 'brigade'=>'resource', 'bucket'=>'object'],
|
||||
'stream_bucket_make_writeable' => ['object', 'brigade'=>'resource'],
|
||||
'stream_bucket_make_writeable' => ['?object', 'brigade'=>'resource'],
|
||||
'stream_bucket_new' => ['object|false', 'stream'=>'resource', 'buffer'=>'string'],
|
||||
'stream_bucket_prepend' => ['void', 'brigade'=>'resource', 'bucket'=>'object'],
|
||||
'stream_context_create' => ['resource', 'options='=>'array', 'params='=>'array'],
|
||||
@ -14590,16 +14590,16 @@ return [
|
||||
'tidy_config_count' => ['int', 'tidy'=>'tidy'],
|
||||
'tidy_diagnose' => ['bool', 'tidy'=>'tidy'],
|
||||
'tidy_error_count' => ['int', 'tidy'=>'tidy'],
|
||||
'tidy_get_body' => ['tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_body' => ['?tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_config' => ['array', 'tidy'=>'tidy'],
|
||||
'tidy_get_error_buffer' => ['string', 'tidy'=>'tidy'],
|
||||
'tidy_get_head' => ['tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_html' => ['tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_head' => ['?tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_html' => ['?tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_html_ver' => ['int', 'tidy'=>'tidy'],
|
||||
'tidy_get_opt_doc' => ['string', 'tidy'=>'tidy', 'option'=>'string'],
|
||||
'tidy_get_output' => ['string', 'tidy'=>'tidy'],
|
||||
'tidy_get_release' => ['string'],
|
||||
'tidy_get_root' => ['tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_root' => ['?tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_status' => ['int', 'tidy'=>'tidy'],
|
||||
'tidy_getopt' => ['mixed', 'tidy'=>'string', 'option'=>'tidy'],
|
||||
'tidy_is_xhtml' => ['bool', 'tidy'=>'tidy'],
|
||||
@ -14868,7 +14868,7 @@ return [
|
||||
'Transliterator::transliterate' => ['string|false', 'subject'=>'string', 'start='=>'int', 'end='=>'int'],
|
||||
'transliterator_create' => ['?Transliterator', 'id'=>'string', 'direction='=>'int'],
|
||||
'transliterator_create_from_rules' => ['?Transliterator', 'rules'=>'string', 'direction='=>'int'],
|
||||
'transliterator_create_inverse' => ['Transliterator', 'transliterator'=>'Transliterator'],
|
||||
'transliterator_create_inverse' => ['?Transliterator', 'transliterator'=>'Transliterator'],
|
||||
'transliterator_get_error_code' => ['int', 'transliterator'=>'Transliterator'],
|
||||
'transliterator_get_error_message' => ['string', 'transliterator'=>'Transliterator'],
|
||||
'transliterator_list_ids' => ['array'],
|
||||
@ -15597,7 +15597,7 @@ return [
|
||||
'xhprof_sample_enable' => ['void'],
|
||||
'xlswriter_get_author' => ['string'],
|
||||
'xlswriter_get_version' => ['string'],
|
||||
'xml_error_string' => ['string', 'error_code'=>'int'],
|
||||
'xml_error_string' => ['?string', 'error_code'=>'int'],
|
||||
'xml_get_current_byte_index' => ['int|false', 'parser'=>'XMLParser'],
|
||||
'xml_get_current_column_number' => ['int|false', 'parser'=>'XMLParser'],
|
||||
'xml_get_current_line_number' => ['int|false', 'parser'=>'XMLParser'],
|
||||
|
@ -26,7 +26,7 @@ return [
|
||||
'openssl_get_curve_names' => ['list<string>'],
|
||||
'pcntl_async_signals' => ['bool', 'enable='=>'bool'],
|
||||
'pcntl_signal_get_handler' => ['int|string', 'signal'=>'int'],
|
||||
'sapi_windows_cp_conv' => ['string', 'in_codepage'=>'int|string', 'out_codepage'=>'int|string', 'subject'=>'string'],
|
||||
'sapi_windows_cp_conv' => ['?string', 'in_codepage'=>'int|string', 'out_codepage'=>'int|string', 'subject'=>'string'],
|
||||
'sapi_windows_cp_get' => ['int'],
|
||||
'sapi_windows_cp_is_utf8' => ['bool'],
|
||||
'sapi_windows_cp_set' => ['bool', 'codepage'=>'int'],
|
||||
|
@ -278,8 +278,8 @@ return [
|
||||
'new' => ['int', 'multi_handle'=>'CurlMultiHandle', '&w_still_running'=>'int'],
|
||||
],
|
||||
'curl_multi_getcontent' => [
|
||||
'old' => ['string', 'ch'=>'resource'],
|
||||
'new' => ['string', 'handle'=>'CurlHandle'],
|
||||
'old' => ['?string', 'ch'=>'resource'],
|
||||
'new' => ['?string', 'handle'=>'CurlHandle'],
|
||||
],
|
||||
'curl_multi_info_read' => [
|
||||
'old' => ['array|false', 'mh'=>'resource', '&w_msgs_in_queue='=>'int'],
|
||||
@ -834,8 +834,8 @@ return [
|
||||
'new' => ['string|false|null', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string', 'options='=>'string|null'],
|
||||
],
|
||||
'mb_ereg_replace_callback' => [
|
||||
'old' => ['string|false', 'pattern'=>'string', 'callback'=>'callable', 'string'=>'string', 'options='=>'string'],
|
||||
'new' => ['string|false', 'pattern'=>'string', 'callback'=>'callable', 'string'=>'string', 'options='=>'string|null'],
|
||||
'old' => ['string|false|null', 'pattern'=>'string', 'callback'=>'callable', 'string'=>'string', 'options='=>'string'],
|
||||
'new' => ['string|false|null', 'pattern'=>'string', 'callback'=>'callable', 'string'=>'string', 'options='=>'string|null'],
|
||||
],
|
||||
'mb_ereg_search' => [
|
||||
'old' => ['bool', 'pattern='=>'string', 'options='=>'string'],
|
||||
|
@ -106,8 +106,8 @@ return [
|
||||
'new' => ['bool', 'ftp' => 'FTP\Connection', 'command' => 'string'],
|
||||
],
|
||||
'ftp_raw' => [
|
||||
'old' => ['array', 'ftp' => 'resource', 'command' => 'string'],
|
||||
'new' => ['array', 'ftp' => 'FTP\Connection', 'command' => 'string'],
|
||||
'old' => ['?array', 'ftp' => 'resource', 'command' => 'string'],
|
||||
'new' => ['?array', 'ftp' => 'FTP\Connection', 'command' => 'string'],
|
||||
],
|
||||
'ftp_mkdir' => [
|
||||
'old' => ['string|false', 'ftp' => 'resource', 'directory' => 'string'],
|
||||
|
@ -9909,7 +9909,7 @@ return [
|
||||
'classkit_method_remove' => ['bool', 'classname'=>'string', 'methodname'=>'string'],
|
||||
'classkit_method_rename' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'newname'=>'string'],
|
||||
'clearstatcache' => ['void', 'clear_realpath_cache='=>'bool', 'filename='=>'string'],
|
||||
'cli_get_process_title' => ['string'],
|
||||
'cli_get_process_title' => ['?string'],
|
||||
'cli_set_process_title' => ['bool', 'title'=>'string'],
|
||||
'closedir' => ['void', 'dir_handle='=>'resource'],
|
||||
'closelog' => ['bool'],
|
||||
@ -9920,7 +9920,7 @@ return [
|
||||
'clusterObj::setGroup' => ['int', 'expression'=>'string'],
|
||||
'collator_asort' => ['bool', 'object'=>'collator', '&rw_array'=>'array', 'flags='=>'int'],
|
||||
'collator_compare' => ['int', 'object'=>'collator', 'string1'=>'string', 'string2'=>'string'],
|
||||
'collator_create' => ['Collator', 'locale'=>'string'],
|
||||
'collator_create' => ['?Collator', 'locale'=>'string'],
|
||||
'collator_get_attribute' => ['int|false', 'object'=>'collator', 'attribute'=>'int'],
|
||||
'collator_get_error_code' => ['int', 'object'=>'collator'],
|
||||
'collator_get_error_message' => ['string', 'object'=>'collator'],
|
||||
@ -10135,7 +10135,7 @@ return [
|
||||
'curl_multi_add_handle' => ['int', 'mh'=>'resource', 'ch'=>'resource'],
|
||||
'curl_multi_close' => ['void', 'mh'=>'resource'],
|
||||
'curl_multi_exec' => ['int', 'mh'=>'resource', '&w_still_running'=>'int'],
|
||||
'curl_multi_getcontent' => ['string', 'ch'=>'resource'],
|
||||
'curl_multi_getcontent' => ['?string', 'ch'=>'resource'],
|
||||
'curl_multi_info_read' => ['array|false', 'mh'=>'resource', '&w_msgs_in_queue='=>'int'],
|
||||
'curl_multi_init' => ['resource|false'],
|
||||
'curl_multi_remove_handle' => ['int', 'mh'=>'resource', 'ch'=>'resource'],
|
||||
@ -10191,7 +10191,7 @@ return [
|
||||
'datefmt_format' => ['string|false', 'formatter'=>'IntlDateFormatter', 'datetime'=>'DateTime|IntlCalendar|array|int'],
|
||||
'datefmt_format_object' => ['string|false', 'datetime'=>'object', 'format='=>'mixed', 'locale='=>'string'],
|
||||
'datefmt_get_calendar' => ['int', 'formatter'=>'IntlDateFormatter'],
|
||||
'datefmt_get_calendar_object' => ['IntlCalendar', 'formatter'=>'IntlDateFormatter'],
|
||||
'datefmt_get_calendar_object' => ['IntlCalendar|false|null', 'formatter'=>'IntlDateFormatter'],
|
||||
'datefmt_get_datetype' => ['int', 'formatter'=>'IntlDateFormatter'],
|
||||
'datefmt_get_error_code' => ['int', 'formatter'=>'IntlDateFormatter'],
|
||||
'datefmt_get_error_message' => ['string', 'formatter'=>'IntlDateFormatter'],
|
||||
@ -10923,7 +10923,7 @@ return [
|
||||
'ftp_put' => ['bool', 'ftp'=>'resource', 'remote_filename'=>'string', 'local_filename'=>'string', 'mode='=>'int', 'offset='=>'int'],
|
||||
'ftp_pwd' => ['string|false', 'ftp'=>'resource'],
|
||||
'ftp_quit' => ['bool', 'ftp'=>'resource'],
|
||||
'ftp_raw' => ['array', 'ftp'=>'resource', 'command'=>'string'],
|
||||
'ftp_raw' => ['?array', 'ftp'=>'resource', 'command'=>'string'],
|
||||
'ftp_rawlist' => ['array|false', 'ftp'=>'resource', 'directory'=>'string', 'recursive='=>'bool'],
|
||||
'ftp_rename' => ['bool', 'ftp'=>'resource', 'from'=>'string', 'to'=>'string'],
|
||||
'ftp_rmdir' => ['bool', 'ftp'=>'resource', 'directory'=>'string'],
|
||||
@ -12272,7 +12272,7 @@ return [
|
||||
'intlcal_after' => ['bool', 'calendar'=>'IntlCalendar', 'other'=>'IntlCalendar'],
|
||||
'intlcal_before' => ['bool', 'calendar'=>'IntlCalendar', 'other'=>'IntlCalendar'],
|
||||
'intlcal_clear' => ['bool', 'calendar'=>'IntlCalendar', 'field='=>'int'],
|
||||
'intlcal_create_instance' => ['IntlCalendar', 'timezone='=>'mixed', 'locale='=>'string'],
|
||||
'intlcal_create_instance' => ['?IntlCalendar', 'timezone='=>'mixed', 'locale='=>'string'],
|
||||
'intlcal_equals' => ['bool', 'calendar'=>'IntlCalendar', 'other'=>'IntlCalendar'],
|
||||
'intlcal_field_difference' => ['int', 'calendar'=>'IntlCalendar', 'timestamp'=>'float', 'field'=>'int'],
|
||||
'intlcal_from_date_time' => ['IntlCalendar', 'datetime'=>'DateTime|string'],
|
||||
@ -12317,8 +12317,8 @@ return [
|
||||
'intlgregcal_set_gregorian_change' => ['void', 'calendar'=>'IntlGregorianCalendar', 'timestamp'=>'float'],
|
||||
'intltz_count_equivalent_ids' => ['int', 'timezoneId'=>'string'],
|
||||
'intltz_create_enumeration' => ['IntlIterator', 'countryOrRawOffset'=>'mixed'],
|
||||
'intltz_create_time_zone' => ['IntlTimeZone', 'timezoneId'=>'string'],
|
||||
'intltz_from_date_time_zone' => ['IntlTimeZone', 'timezone'=>'DateTimeZone'],
|
||||
'intltz_create_time_zone' => ['?IntlTimeZone', 'timezoneId'=>'string'],
|
||||
'intltz_from_date_time_zone' => ['?IntlTimeZone', 'timezone'=>'DateTimeZone'],
|
||||
'intltz_getGMT' => ['IntlTimeZone'],
|
||||
'intltz_get_canonical_id' => ['string', 'timezoneId'=>'string', '&isSystemId'=>'bool'],
|
||||
'intltz_get_display_name' => ['string', 'timezone'=>'IntlTimeZone', 'dst'=>'bool', 'style'=>'int', 'locale'=>'string'],
|
||||
@ -12558,22 +12558,22 @@ return [
|
||||
'litespeed_request_headers' => ['array'],
|
||||
'litespeed_response_headers' => ['array'],
|
||||
'locale_accept_from_http' => ['string|false', 'header'=>'string'],
|
||||
'locale_canonicalize' => ['string', 'locale'=>'string'],
|
||||
'locale_canonicalize' => ['?string', 'locale'=>'string'],
|
||||
'locale_compose' => ['string|false', 'subtags'=>'array'],
|
||||
'locale_filter_matches' => ['bool', 'languageTag'=>'string', 'locale'=>'string', 'canonicalize='=>'bool'],
|
||||
'locale_get_all_variants' => ['array', 'locale'=>'string'],
|
||||
'locale_filter_matches' => ['?bool', 'languageTag'=>'string', 'locale'=>'string', 'canonicalize='=>'bool'],
|
||||
'locale_get_all_variants' => ['?array', 'locale'=>'string'],
|
||||
'locale_get_default' => ['string'],
|
||||
'locale_get_display_language' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
|
||||
'locale_get_display_name' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
|
||||
'locale_get_display_region' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
|
||||
'locale_get_display_script' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
|
||||
'locale_get_display_variant' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
|
||||
'locale_get_keywords' => ['array|false', 'locale'=>'string'],
|
||||
'locale_get_primary_language' => ['string', 'locale'=>'string'],
|
||||
'locale_get_region' => ['string', 'locale'=>'string'],
|
||||
'locale_get_script' => ['string', 'locale'=>'string'],
|
||||
'locale_lookup' => ['string', 'languageTag'=>'array', 'locale'=>'string', 'canonicalize='=>'bool', 'defaultLocale='=>'string'],
|
||||
'locale_parse' => ['array', 'locale'=>'string'],
|
||||
'locale_get_keywords' => ['array|false|null', 'locale'=>'string'],
|
||||
'locale_get_primary_language' => ['?string', 'locale'=>'string'],
|
||||
'locale_get_region' => ['?string', 'locale'=>'string'],
|
||||
'locale_get_script' => ['?string', 'locale'=>'string'],
|
||||
'locale_lookup' => ['?string', 'languageTag'=>'array', 'locale'=>'string', 'canonicalize='=>'bool', 'defaultLocale='=>'string'],
|
||||
'locale_parse' => ['?array', 'locale'=>'string'],
|
||||
'locale_set_default' => ['bool', 'locale'=>'string'],
|
||||
'localeconv' => ['array'],
|
||||
'localtime' => ['array', 'timestamp='=>'int', 'associative='=>'bool'],
|
||||
@ -12893,7 +12893,7 @@ return [
|
||||
'mb_ereg' => ['int|false', 'pattern'=>'string', 'string'=>'string', '&w_matches='=>'array|null'],
|
||||
'mb_ereg_match' => ['bool', 'pattern'=>'string', 'string'=>'string', 'options='=>'string'],
|
||||
'mb_ereg_replace' => ['string|false', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string', 'options='=>'string'],
|
||||
'mb_ereg_replace_callback' => ['string|false', 'pattern'=>'string', 'callback'=>'callable', 'string'=>'string', 'options='=>'string'],
|
||||
'mb_ereg_replace_callback' => ['string|false|null', 'pattern'=>'string', 'callback'=>'callable', 'string'=>'string', 'options='=>'string'],
|
||||
'mb_ereg_search' => ['bool', 'pattern='=>'string', 'options='=>'string'],
|
||||
'mb_ereg_search_getpos' => ['int'],
|
||||
'mb_ereg_search_getregs' => ['string[]|false'],
|
||||
@ -13122,7 +13122,7 @@ return [
|
||||
'msg_send' => ['bool', 'queue'=>'resource', 'message_type'=>'int', 'message'=>'mixed', 'serialize='=>'bool', 'blocking='=>'bool', '&w_error_code='=>'int'],
|
||||
'msg_set_queue' => ['bool', 'queue'=>'resource', 'data'=>'array'],
|
||||
'msg_stat_queue' => ['array', 'queue'=>'resource'],
|
||||
'msgfmt_create' => ['MessageFormatter', 'locale'=>'string', 'pattern'=>'string'],
|
||||
'msgfmt_create' => ['?MessageFormatter', 'locale'=>'string', 'pattern'=>'string'],
|
||||
'msgfmt_format' => ['string|false', 'formatter'=>'MessageFormatter', 'values'=>'array'],
|
||||
'msgfmt_format_message' => ['string|false', 'locale'=>'string', 'pattern'=>'string', 'values'=>'array'],
|
||||
'msgfmt_get_error_code' => ['int', 'formatter'=>'MessageFormatter'],
|
||||
@ -13418,7 +13418,7 @@ return [
|
||||
'mysqli_field_tell' => ['int', 'result'=>'mysqli_result'],
|
||||
'mysqli_free_result' => ['void', 'result'=>'mysqli_result'],
|
||||
'mysqli_get_cache_stats' => ['array|false'],
|
||||
'mysqli_get_charset' => ['object', 'mysql'=>'mysqli'],
|
||||
'mysqli_get_charset' => ['?object', 'mysql'=>'mysqli'],
|
||||
'mysqli_get_client_info' => ['string', 'mysql='=>'?mysqli'],
|
||||
'mysqli_get_client_stats' => ['array'],
|
||||
'mysqli_get_client_version' => ['int', 'link'=>'mysqli'],
|
||||
@ -15221,7 +15221,7 @@ return [
|
||||
'streamWrapper::unlink' => ['bool', 'path'=>'string'],
|
||||
'streamWrapper::url_stat' => ['array', 'path'=>'string', 'flags'=>'int'],
|
||||
'stream_bucket_append' => ['void', 'brigade'=>'resource', 'bucket'=>'object'],
|
||||
'stream_bucket_make_writeable' => ['object', 'brigade'=>'resource'],
|
||||
'stream_bucket_make_writeable' => ['?object', 'brigade'=>'resource'],
|
||||
'stream_bucket_new' => ['object|false', 'stream'=>'resource', 'buffer'=>'string'],
|
||||
'stream_bucket_prepend' => ['void', 'brigade'=>'resource', 'bucket'=>'object'],
|
||||
'stream_context_create' => ['resource', 'options='=>'array', 'params='=>'array'],
|
||||
@ -15739,16 +15739,16 @@ return [
|
||||
'tidy_config_count' => ['int', 'tidy'=>'tidy'],
|
||||
'tidy_diagnose' => ['bool', 'tidy'=>'tidy'],
|
||||
'tidy_error_count' => ['int', 'tidy'=>'tidy'],
|
||||
'tidy_get_body' => ['tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_body' => ['?tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_config' => ['array', 'tidy'=>'tidy'],
|
||||
'tidy_get_error_buffer' => ['string', 'tidy'=>'tidy'],
|
||||
'tidy_get_head' => ['tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_html' => ['tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_head' => ['?tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_html' => ['?tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_html_ver' => ['int', 'tidy'=>'tidy'],
|
||||
'tidy_get_opt_doc' => ['string', 'tidy'=>'tidy', 'option'=>'string'],
|
||||
'tidy_get_output' => ['string', 'tidy'=>'tidy'],
|
||||
'tidy_get_release' => ['string'],
|
||||
'tidy_get_root' => ['tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_root' => ['?tidyNode', 'tidy'=>'tidy'],
|
||||
'tidy_get_status' => ['int', 'tidy'=>'tidy'],
|
||||
'tidy_getopt' => ['mixed', 'tidy'=>'string', 'option'=>'tidy'],
|
||||
'tidy_is_xhtml' => ['bool', 'tidy'=>'tidy'],
|
||||
@ -15945,7 +15945,7 @@ return [
|
||||
'trait_exists' => ['bool', 'trait'=>'string', 'autoload='=>'bool'],
|
||||
'transliterator_create' => ['?Transliterator', 'id'=>'string', 'direction='=>'int'],
|
||||
'transliterator_create_from_rules' => ['?Transliterator', 'rules'=>'string', 'direction='=>'int'],
|
||||
'transliterator_create_inverse' => ['Transliterator', 'transliterator'=>'Transliterator'],
|
||||
'transliterator_create_inverse' => ['?Transliterator', 'transliterator'=>'Transliterator'],
|
||||
'transliterator_get_error_code' => ['int', 'transliterator'=>'Transliterator'],
|
||||
'transliterator_get_error_message' => ['string', 'transliterator'=>'Transliterator'],
|
||||
'transliterator_list_ids' => ['array'],
|
||||
@ -16412,7 +16412,7 @@ return [
|
||||
'xhprof_sample_enable' => ['void'],
|
||||
'xlswriter_get_author' => ['string'],
|
||||
'xlswriter_get_version' => ['string'],
|
||||
'xml_error_string' => ['string', 'error_code'=>'int'],
|
||||
'xml_error_string' => ['?string', 'error_code'=>'int'],
|
||||
'xml_get_current_byte_index' => ['int|false', 'parser'=>'resource'],
|
||||
'xml_get_current_column_number' => ['int|false', 'parser'=>'resource'],
|
||||
'xml_get_current_line_number' => ['int|false', 'parser'=>'resource'],
|
||||
|
@ -1275,7 +1275,7 @@ function pack(string $format, mixed ...$values) {}
|
||||
* @param string|int $out_codepage
|
||||
* @psalm-flow ($subject) -> return
|
||||
*/
|
||||
function sapi_windows_cp_conv($in_codepage, $out_codepage, string $subject) : string {}
|
||||
function sapi_windows_cp_conv($in_codepage, $out_codepage, string $subject) : ?string {}
|
||||
|
||||
/**
|
||||
* @psalm-pure
|
||||
|
@ -750,7 +750,7 @@ class InternalCallMapHandlerTest extends TestCase
|
||||
$expectedType = $param->getType();
|
||||
|
||||
if (isset($expectedType) && !empty($normalizedEntry['type'])) {
|
||||
$this->assertTypeValidity($expectedType, $normalizedEntry['type'], "Param '{$name}' has incorrect type");
|
||||
$this->assertTypeValidity($expectedType, $normalizedEntry['type'], false, "Param '{$name}' has incorrect type");
|
||||
}
|
||||
}
|
||||
|
||||
@ -771,20 +771,19 @@ class InternalCallMapHandlerTest extends TestCase
|
||||
return;
|
||||
}
|
||||
|
||||
$this->assertTypeValidity($expectedType, $entryReturnType, 'CallMap entry has incorrect return type');
|
||||
$this->assertTypeValidity($expectedType, $entryReturnType, true, 'CallMap entry has incorrect return type');
|
||||
}
|
||||
|
||||
/**
|
||||
* Since string equality is too strict, we do some extra checking here
|
||||
*/
|
||||
private function assertTypeValidity(ReflectionType $reflected, string $specified, string $message): void
|
||||
private function assertTypeValidity(ReflectionType $reflected, string $specified, bool $checkNullable, string $message): void
|
||||
{
|
||||
$expectedType = Reflection::getPsalmTypeFromReflectionType($reflected);
|
||||
|
||||
$parsedType = Type::parseString($specified);
|
||||
$callMapType = Type::parseString($specified);
|
||||
|
||||
try {
|
||||
$this->assertTrue(UnionTypeComparator::isContainedBy(self::$codebase, $parsedType, $expectedType), $message);
|
||||
$this->assertTrue(UnionTypeComparator::isContainedBy(self::$codebase, $callMapType, $expectedType), $message);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
if (preg_match('/^Could not get class storage for (.*)$/', $e->getMessage(), $matches)
|
||||
&& !class_exists($matches[1])
|
||||
@ -792,5 +791,10 @@ class InternalCallMapHandlerTest extends TestCase
|
||||
$this->fail("Class used in CallMap does not exist: {$matches[1]}");
|
||||
}
|
||||
}
|
||||
|
||||
// Reflection::getPsalmTypeFromReflectionType adds |null to mixed types so skip comparison
|
||||
if ($checkNullable && !$expectedType->hasMixed()) {
|
||||
$this->assertSame($expectedType->isNullable(), $callMapType->isNullable(), $message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user