From 531105c190c4bd016bcd555e8eb1e4fc9ffc6ab5 Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Thu, 14 Mar 2024 00:35:05 +0100 Subject: [PATCH] Fix https://github.com/vimeo/psalm/issues/7550 --- dictionaries/CallMap.php | 38 ++++++++--------- dictionaries/CallMap_81_delta.php | 68 +++++++++++++++++++++++++++++++ dictionaries/CallMap_83_delta.php | 8 ++++ 3 files changed, 95 insertions(+), 19 deletions(-) diff --git a/dictionaries/CallMap.php b/dictionaries/CallMap.php index 80de3809a85..e4442fcf28f 100644 --- a/dictionaries/CallMap.php +++ b/dictionaries/CallMap.php @@ -1142,17 +1142,17 @@ 'crash' => [''], 'crc32' => ['int', 'string'=>'string'], 'crypt' => ['string', 'string'=>'string', 'salt'=>'string'], -'ctype_alnum' => ['bool', 'text'=>'string|int'], -'ctype_alpha' => ['bool', 'text'=>'string|int'], -'ctype_cntrl' => ['bool', 'text'=>'string|int'], -'ctype_digit' => ['bool', 'text'=>'string|int'], -'ctype_graph' => ['bool', 'text'=>'string|int'], -'ctype_lower' => ['bool', 'text'=>'string|int'], -'ctype_print' => ['bool', 'text'=>'string|int'], -'ctype_punct' => ['bool', 'text'=>'string|int'], -'ctype_space' => ['bool', 'text'=>'string|int'], -'ctype_upper' => ['bool', 'text'=>'string|int'], -'ctype_xdigit' => ['bool', 'text'=>'string|int'], +'ctype_alnum' => ['bool', 'text'=>'string'], +'ctype_alpha' => ['bool', 'text'=>'string'], +'ctype_cntrl' => ['bool', 'text'=>'string'], +'ctype_digit' => ['bool', 'text'=>'string'], +'ctype_graph' => ['bool', 'text'=>'string'], +'ctype_lower' => ['bool', 'text'=>'string'], +'ctype_print' => ['bool', 'text'=>'string'], +'ctype_punct' => ['bool', 'text'=>'string'], +'ctype_space' => ['bool', 'text'=>'string'], +'ctype_upper' => ['bool', 'text'=>'string'], +'ctype_xdigit' => ['bool', 'text'=>'string'], 'cubrid_affected_rows' => ['int', 'req_identifier='=>''], 'cubrid_bind' => ['bool', 'req_identifier'=>'resource', 'bind_param'=>'int', 'bind_value'=>'mixed', 'bind_value_type='=>'string'], 'cubrid_client_encoding' => ['string', 'conn_identifier='=>''], @@ -1293,7 +1293,7 @@ 'CURLFile::setMimeType' => ['void', 'mime_type'=>'string'], 'CURLFile::setPostFilename' => ['void', 'posted_filename'=>'string'], 'CURLStringFile::__construct' => ['void', 'data'=>'string', 'postname'=>'string', 'mime='=>'string'], -'current' => ['mixed|false', 'array'=>'array|object'], +'current' => ['mixed|false', 'array'=>'array'], 'cyrus_authenticate' => ['void', 'connection'=>'resource', 'mechlist='=>'string', 'service='=>'string', 'user='=>'string', 'minssf='=>'int', 'maxssf='=>'int', 'authname='=>'string', 'password='=>'string'], 'cyrus_bind' => ['bool', 'connection'=>'resource', 'callbacks'=>'array'], 'cyrus_close' => ['bool', 'connection'=>'resource'], @@ -3269,7 +3269,7 @@ 'get_call_stack' => [''], 'get_called_class' => ['class-string'], 'get_cfg_var' => ['string|false', 'option'=>'string'], -'get_class' => ['class-string', 'object='=>'object'], +'get_class' => ['class-string', 'object'=>'object'], 'get_class_methods' => ['list', 'object_or_class'=>'object|class-string'], 'get_class_vars' => ['array', 'class'=>'string'], 'get_current_user' => ['string'], @@ -3290,7 +3290,7 @@ 'get_magic_quotes_runtime' => ['int|false'], 'get_meta_tags' => ['array', 'filename'=>'string', 'use_include_path='=>'bool'], 'get_object_vars' => ['array', 'object'=>'object'], -'get_parent_class' => ['class-string|false', 'object_or_class='=>'object|class-string'], +'get_parent_class' => ['class-string|false', 'object_or_class'=>'object|class-string'], 'get_required_files' => ['list'], 'get_resource_id' => ['int', 'resource'=>'resource'], 'get_resource_type' => ['string', 'resource'=>'resource'], @@ -6198,7 +6198,7 @@ 'kadm5_get_principals' => ['array', 'handle'=>'resource'], 'kadm5_init_with_password' => ['resource', 'admin_server'=>'string', 'realm'=>'string', 'principal'=>'string', 'password'=>'string'], 'kadm5_modify_principal' => ['bool', 'handle'=>'resource', 'principal'=>'string', 'options'=>'array'], -'key' => ['int|string|null', 'array'=>'array|object'], +'key' => ['int|string|null', 'array'=>'array'], 'key_exists' => ['bool', 'key'=>'string|int', 'array'=>'array'], 'krsort' => ['true', '&rw_array'=>'array', 'flags='=>'int'], 'ksort' => ['true', '&rw_array'=>'array', 'flags='=>'int'], @@ -6598,7 +6598,7 @@ 'mapObj::zoomScale' => ['int', 'nScaleDenom'=>'float', 'oPixelPos'=>'pointObj', 'nImageWidth'=>'int', 'nImageHeight'=>'int', 'oGeorefExt'=>'rectObj', 'oMaxGeorefExt'=>'rectObj'], 'max' => ['mixed', 'value'=>'non-empty-array'], 'max\'1' => ['mixed', 'value'=>'', 'values'=>'', '...args='=>''], -'mb_check_encoding' => ['bool', 'value='=>'array|string|null', 'encoding='=>'string|null'], +'mb_check_encoding' => ['bool', 'value'=>'array|string', 'encoding='=>'string|null'], 'mb_chr' => ['non-empty-string|false', 'codepoint'=>'int', 'encoding='=>'string|null'], 'mb_convert_case' => ['string', 'string'=>'string', 'mode'=>'int', 'encoding='=>'string|null'], 'mb_convert_encoding' => ['string|false', 'string'=>'string', 'to_encoding'=>'string', 'from_encoding='=>'array|string|null'], @@ -8149,7 +8149,7 @@ 'newrelic_set_appname' => ['bool', 'name'=>'string', 'license='=>'string', 'xmit='=>'bool'], 'newrelic_set_user_attributes' => ['bool', 'user'=>'string', 'account'=>'string', 'product'=>'string'], 'newrelic_start_transaction' => ['bool', 'appname'=>'string', 'license='=>'string'], -'next' => ['mixed', '&r_array'=>'array|object'], +'next' => ['mixed', '&r_array'=>'array'], 'ngettext' => ['string', 'singular'=>'string', 'plural'=>'string', 'count'=>'int'], 'nl2br' => ['string', 'string'=>'string', 'use_xhtml='=>'bool'], 'nl_langinfo' => ['string|false', 'item'=>'int'], @@ -9429,7 +9429,7 @@ 'preg_replace_callback_array\'1' => ['string[]|null', 'pattern'=>'array', 'subject'=>'string[]', 'limit='=>'int', '&w_count='=>'int', 'flags='=>'int'], 'preg_split' => ['list|false', 'pattern'=>'string', 'subject'=>'string', 'limit'=>'int', 'flags='=>'null'], 'preg_split\'1' => ['list|list>|false', 'pattern'=>'string', 'subject'=>'string', 'limit='=>'int', 'flags='=>'int'], -'prev' => ['mixed', '&r_array'=>'array|object'], +'prev' => ['mixed', '&r_array'=>'array'], 'print' => ['int', 'arg'=>'string'], 'print_r' => ['string', 'value'=>'mixed'], 'print_r\'1' => ['true', 'value'=>'mixed', 'return='=>'bool'], @@ -10699,7 +10699,7 @@ 'register_tick_function' => ['bool', 'callback'=>'callable():void', '...args='=>'mixed'], 'rename' => ['bool', 'from'=>'string', 'to'=>'string', 'context='=>'resource'], 'rename_function' => ['bool', 'original_name'=>'string', 'new_name'=>'string'], -'reset' => ['mixed|false', '&r_array'=>'array|object'], +'reset' => ['mixed|false', '&r_array'=>'array'], 'ResourceBundle::__construct' => ['void', 'locale'=>'?string', 'bundle'=>'?string', 'fallback='=>'bool'], 'ResourceBundle::count' => ['int'], 'ResourceBundle::create' => ['?ResourceBundle', 'locale'=>'?string', 'bundle'=>'?string', 'fallback='=>'bool'], diff --git a/dictionaries/CallMap_81_delta.php b/dictionaries/CallMap_81_delta.php index bfb2da40bb6..7fc0540bbb8 100644 --- a/dictionaries/CallMap_81_delta.php +++ b/dictionaries/CallMap_81_delta.php @@ -1211,6 +1211,74 @@ 'old' => ['int|false', '&rw_read'=>'?resource[]', '&rw_write'=>'?resource[]', '&rw_except'=>'?resource[]', 'seconds'=>'?int', 'microseconds='=>'int'], 'new' => ['int|false', '&rw_read'=>'?resource[]', '&rw_write'=>'?resource[]', '&rw_except'=>'?resource[]', 'seconds'=>'?int', 'microseconds='=>'?int'], ], + 'mb_check_encoding' => [ + 'old' => ['bool', 'value='=>'array|string', 'encoding='=>'string'], + 'new' => ['bool', 'value'=>'array|string', 'encoding='=>'string|null'], + ], + 'ctype_alnum' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'ctype_alpha' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'ctype_cntrl' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'ctype_digit' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'ctype_graph' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'ctype_lower' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'ctype_print' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'ctype_punct' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'ctype_space' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'ctype_upper' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'ctype_xdigit' => [ + 'old' => ['bool', 'text'=>'string|int'], + 'new' => ['bool', 'text'=>'string'], + ], + 'key' => [ + 'old' => ['int|string|null', 'array'=>'array|object'], + 'new' => ['int|string|null', 'array'=>'array'], + ], + 'current' => [ + 'old' => ['mixed|false', 'array'=>'array|object'], + 'new' => ['mixed|false', 'array'=>'array'], + ], + 'next' => [ + 'old' => ['mixed', '&r_array'=>'array|object'], + 'new' => ['mixed', '&r_array'=>'array'], + ], + 'prev' => [ + 'old' => ['mixed', '&r_array'=>'array|object'], + 'new' => ['mixed', '&r_array'=>'array'], + ], + 'reset' => [ + 'old' => ['mixed|false', '&r_array'=>'array|object'], + 'new' => ['mixed|false', '&r_array'=>'array'], + ], ], 'removed' => [ diff --git a/dictionaries/CallMap_83_delta.php b/dictionaries/CallMap_83_delta.php index 8a4a76077b8..005017e4dfe 100644 --- a/dictionaries/CallMap_83_delta.php +++ b/dictionaries/CallMap_83_delta.php @@ -117,6 +117,14 @@ 'old' => ['string|false', 'haystack'=>'string', 'needle'=>'string'], 'new' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool'], ], + 'get_class' => [ + 'old' => ['class-string', 'object='=>'object'], + 'new' => ['class-string', 'object'=>'object'], + ], + 'get_parent_class' => [ + 'old' => ['class-string|false', 'object_or_class='=>'object|class-string'], + 'new' => ['class-string|false', 'object_or_class'=>'object|class-string'], + ], ], 'removed' => [