Skip to content

Commit

Permalink
Extend impure_functions list by socket functions
Browse files Browse the repository at this point in the history
all of them returns boolean and can be ignored.
This prevents UnusedFunctionCall.
Note, socket errors can be fetched by:
 - socket_strerror
 - socket_last_error
  • Loading branch information
alies-dev committed Dec 4, 2022
1 parent cc9c67d commit 4b4b36d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Psalm/Internal/Codebase/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ public function isCallMapFunctionPure(
// stream/socket io
'stream_context_set_option', 'socket_write', 'stream_set_blocking', 'socket_close',
'socket_set_option', 'stream_set_write_buffer', 'stream_socket_enable_crypto', 'stream_copy_to_stream',
'stream_wrapper_register',
'stream_wrapper_register', 'socket_connect', 'socket_bind', 'socket_set_block', 'socket_set_nonblock',
'socket_listen',

// meta calls
'call_user_func', 'call_user_func_array', 'define', 'create_function',
Expand Down

0 comments on commit 4b4b36d

Please sign in to comment.