New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix nullable return types for CallMap functions #8228
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1066,7 +1066,7 @@ | |
'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 @@ | |
'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 @@ | |
'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 @@ | |
'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 @@ | |
'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 @@ | |
'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 @@ | |
'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 @@ | |
'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'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These locale functions return null when locale string is too big. Do we want to ignore this possibility? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's a valid concern for some usage so we should allow users to guard against it. Note that Psalm has two configs (ignoreInternalFunctionNullReturn and ignoreInternalFunctionFalseReturn) that will make Psalm less strict about unhandled false/null returns from internal functions. Adding false or null to signature should not disturb users very much |
||
'locale_set_default' => ['bool', 'locale'=>'string'], | ||
'localeconv' => ['array'], | ||
'localtime' => ['array', 'timestamp='=>'int', 'associative='=>'bool'], | ||
|
@@ -7279,7 +7279,7 @@ | |
'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 @@ | |
'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 @@ | |
'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 @@ | |
'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 @@ | |
'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 @@ | |
'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 @@ | |
'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 @@ | |
'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'], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also adds missing
false
.