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

Function mysqli_get_client_info invoked with 0 parameters, 1 required. #4013

Closed
jrfnl opened this issue Oct 27, 2020 · 6 comments
Closed

Function mysqli_get_client_info invoked with 0 parameters, 1 required. #4013

jrfnl opened this issue Oct 27, 2020 · 6 comments
Labels

Comments

@jrfnl
Copy link

jrfnl commented Oct 27, 2020

Bug report

Function mysqli_get_client_info invoked with 0 parameters, 1 required.

Code snippet that reproduces the problem

https://phpstan.org/r/e5dd46fa-edfa-40d9-b4af-924337d111c6 (PHP 7.1-7.4 tab)

Expected output

No errors.

The parameter has always been optional: https://www.php.net/manual/en/mysqli.get-client-info.php

@ondrejmirtes
Copy link
Member

Hi Juliette, these can be usually fixed in this file https://github.com/phpstan/phpstan-src/blob/master/resources/functionMap.php so feel free to send a PR :) Thanks

@jrfnl
Copy link
Author

jrfnl commented Oct 27, 2020

I looked at that file (even before reporting the issue) and couldn't for the life of me figure out how to indicate optional/required parameter, so sorry, no I will not fix this.

@ondrejmirtes
Copy link
Member

There's documentation at the top of the file:

  • A '=' following the <arg_name> indicates this arg is optional.

For example:

'explode' => ['array<int,string>|false', 'separator'=>'string', 'str'=>'string', 'limit='=>'int'],

@jrfnl
Copy link
Author

jrfnl commented Oct 27, 2020

Must have missed that. Still not going to send in a PR. I contribute to enough projects as it is.

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@b01c6c9

@github-actions
Copy link

github-actions bot commented May 7, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants