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

Incorrect named argument for getenv #9823

Closed
postme opened this issue Aug 30, 2023 · 2 comments
Closed

Incorrect named argument for getenv #9823

postme opened this issue Aug 30, 2023 · 2 comments
Labels

Comments

@postme
Copy link

postme commented Aug 30, 2023

Bug report

phpstan expects named argument 'varname' for function getenv. This is incorrect and should be named argument 'name'

php docs:
getenv(?string $name = null, bool $local_only = false): string|array|false

phpstan reports incorrect error:
Missing parameter $varname (string) in call to function getenv. argument.missing
Unknown parameter $var in call to function getenv. argument.unknown

Code snippet that reproduces the problem

https://phpstan.org/r/badcfad5-9a39-48e1-8098-87849b5c8c02

Expected output

phpstan should not report an error when using named argument 'name' in function getenv()

Did PHPStan help you today? Did it make you happy in any way?

love phpstan!

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src#2726

Copy link

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 Dec 16, 2023
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