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 mixed type with openssl_sign and signature variable #11791

Closed
piotrekkr opened this issue Oct 3, 2024 · 3 comments · May be fixed by phpstan/phpstan-src#3532
Closed

Incorrect mixed type with openssl_sign and signature variable #11791

piotrekkr opened this issue Oct 3, 2024 · 3 comments · May be fixed by phpstan/phpstan-src#3532

Comments

@piotrekkr
Copy link

Bug report

When using openssl_sign, signature variable is reported as mixed when it should be reported as string. As a result rector tool is adding (string) cast for base64_encode($var) when used. Then after rector psalm complains about unnecessary cast to string.

By following docs on openssl_sign

signature

    If the call was successful the signature is returned in signature.

So type should not be changed from string to mixed after openssl_sign() is used.

Code snippet that reproduces the problem

https://phpstan.org/r/5567ebe6-946a-4f5d-a0e0-871133d0cb33

Expected output

Dumped type: string

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

No response

@piotrekkr
Copy link
Author

Related to rectorphp/rector#8847

@ondrejmirtes
Copy link
Member

Please follow #11777

piotrekkr added a commit to piotrekkr/phpstan-src that referenced this issue Oct 3, 2024
…re` variable type which is now shown as `mixed` instead of `string`.

Fixes phpstan/phpstan#11791
Copy link

github-actions bot commented Nov 4, 2024

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 Nov 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants