-
Notifications
You must be signed in to change notification settings - Fork 431
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
Fixed signatures of gmp_div, odbc_exec and unregister_tick_function #533
Conversation
resources/functionMap.php
Outdated
@@ -8012,7 +8012,7 @@ | |||
'odbc_do' => ['resource', 'connection_id'=>'resource', 'query'=>'string', 'flags='=>'int'], | |||
'odbc_error' => ['string', 'connection_id='=>'resource'], | |||
'odbc_errormsg' => ['string', 'connection_id='=>'resource'], | |||
'odbc_exec' => ['resource', 'connection_id'=>'resource', 'query'=>'string', 'flags='=>'int'], | |||
'odbc_exec' => ['resource|false', 'connection_id'=>'resource', 'query'=>'string', 'flags='=>'int'], // Note: 'flags' was removed in PHP 8.0 |
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.
The note is useless here, you can submit a change to https://github.com/phpstan/phpstan-src/blob/master/resources/functionMap_php80delta.php instead
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.
Okay. Will you do it, or do I need to send a new pull request?
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.
Modify this PR so it can be merged, thanks.
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.
Ok, I changed the PR
resources/functionMap.php
Outdated
@@ -12639,7 +12639,7 @@ | |||
'unixtojd' => ['int|false', 'timestamp='=>'int'], | |||
'unlink' => ['bool', 'filename'=>'string', 'context='=>'resource'], | |||
'unpack' => ['array|false', 'format'=>'string', 'data'=>'string', 'offset='=>'int'], | |||
'unregister_tick_function' => ['void', 'function_name'=>'string'], | |||
'unregister_tick_function' => ['void', 'callback'=>'callable'], |
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.
The parameter does not need to be renamed
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.
Okay, sounds good. I just looked in the old manual . In PHP 7, it was called "$function_name" , and in PHP 8 it was renamed to "$callback" (so it should be renamed in functionMap_php80delta.php then)
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 doesn't need to be done, the PHP 8 signatures are mostly taken from https://github.com/phpstan/php-8-stubs/blob/main/stubs/ext/standard/unregister_tick_function.php already.
Thank you! |
gmp_div: Return type is GMP , not resource
odbc_exec: Return type is resource|false , not resource
Note that the "flags" argument will be removed in PHP 8.0
unregister_tick_function: argument is now called "callback" and type "callable" instead of "string"
Example: $callable=array(&$object, 'my_method') or $callable=array('Object', 'my_method')