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

remove fake params from setcookie/setrawcookie #2752

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

schlndh
Copy link
Contributor

@schlndh schlndh commented Nov 20, 2023

Fixes phpstan/phpstan#10171

It turns out that this is wrong: #152 When I try to call setcookie with all 9 parameters it says that max 7 are accepted (PHP 8.2), named arguments such as samesite: 'lax' also don't work. I'm guessing that the arguments in the php_setcookie C function are there to cover the different variants + setcookie vs setrawcookie, but I haven't checked it.

https://3v4l.org/eN9lM

@schlndh
Copy link
Contributor Author

schlndh commented Nov 20, 2023

However, the documentation states that the second signature, which takes an array as the third parameter, is not usable with named parameters.

The documentation is wrong about this - both variants seem to work with named arguments (at least on PHP 8.2).

@schlndh
Copy link
Contributor Author

schlndh commented Nov 20, 2023

The wrong signature from functionMap triggered this condition:

that's why it was excluded from the named variants.

@ondrejmirtes ondrejmirtes merged commit c098fc8 into phpstan:1.10.x Nov 20, 2023
425 checks passed
@ondrejmirtes
Copy link
Member

Wow, these are such tricky problems 😊 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants