Skip to content
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

Update functionMap #2783

Merged
merged 3 commits into from
Nov 27, 2023
Merged

Conversation

zonuexe
Copy link
Contributor

@zonuexe zonuexe commented Nov 26, 2023

No description provided.

@@ -12017,7 +12017,7 @@
'stream_set_write_buffer' => ['int', 'fp'=>'resource', 'buffer'=>'int'],
'stream_socket_accept' => ['resource|false', 'serverstream'=>'resource', 'timeout='=>'float', '&w_peername='=>'string'],
'stream_socket_client' => ['resource|false', 'remoteaddress'=>'string', '&w_errcode='=>'int', '&w_errstring='=>'string', 'timeout='=>'float', 'flags='=>'int', 'context='=>'resource'],
'stream_socket_enable_crypto' => ['int|bool', 'stream'=>'resource', 'enable'=>'bool', 'cryptokind='=>'int', 'sessionstream='=>'resource'],
'stream_socket_enable_crypto' => ['0|bool', 'stream'=>'resource', 'enable'=>'bool', 'crypto_method='=>'int', 'session_stream='=>'resource'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameters don't need to be renamed

@@ -3334,7 +3334,7 @@
'getimagesize' => ['array{0:int, 1: int, 2: int, 3: string, mime: string, channels?: int, bits?: int}|false', 'imagefile'=>'string', '&w_info='=>'array'],
'getimagesizefromstring' => ['array{0:int, 1: int, 2: int, 3: string, mime: string, channels?: int, bits?: int}|false', 'data'=>'string', '&w_info='=>'array'],
'getlastmod' => ['int|false'],
'getmxrr' => ['bool', 'hostname'=>'string', '&w_mxhosts'=>'array', '&w_weight='=>'array'],
'getmxrr' => ['bool', 'hostname'=>'string', '&w_mxhosts'=>'list<string>', '&w_weight='=>'list<0, 65535>'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What effect should this have? The types aren't enforced: https://phpstan.org/r/25c3b187-4888-4aa4-86ad-5e350f16346f

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, it turns out that typing like @param-out cannot be solved by modifying only the functionMap.

https://phpstan.org/r/3c7a8a08-abce-45c9-b310-0bcb4e4b6ba4

The execution results of the function are as follows:

スクリーンショット 2023-11-27 3 30 35

@zonuexe zonuexe force-pushed the update/function-maps branch from 076bb7b to 6b3f805 Compare November 26, 2023 18:47

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@zonuexe zonuexe force-pushed the update/function-maps branch from 6b3f805 to 046ea30 Compare November 27, 2023 02:58

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@zonuexe zonuexe force-pushed the update/function-maps branch from 49433f2 to fff2584 Compare November 27, 2023 06:11
@zonuexe zonuexe requested a review from ondrejmirtes November 27, 2023 06:26
@ondrejmirtes ondrejmirtes merged commit c8a7996 into phpstan:1.10.x Nov 27, 2023
@ondrejmirtes
Copy link
Member

Thank you!

@zonuexe zonuexe deleted the update/function-maps branch November 27, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants