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

Wrong type on openssl_ functions #380

Open
pyrou opened this issue Aug 19, 2022 · 5 comments · Fixed by #381
Open

Wrong type on openssl_ functions #380

pyrou opened this issue Aug 19, 2022 · 5 comments · Fixed by #381
Assignees

Comments

@pyrou
Copy link

pyrou commented Aug 19, 2022

According to PHP documentation, openssl_x509_read accept OpenSSLCertificate|string and return OpenSSLCertificate|false.

On generated Safe wrapper, types are currently ressource|string and resource, making static analyzer fail when passing and OpenSSLCertificate instance, or when expecting OpenSSLCertificate.

Other openssl_ functions seems also affected, like openssl_verify, openssl_x509_fingerprint, openssl_x509_export, openssl_x509_export_to_file, openssl_spki_new etc..

@moufmouf
Copy link
Member

Hey Pyrou!

I'm pretty sure this is due to the change of type between PHP 7 and PHP 8 (most "resources" have been replaced with PHP classes).
@Kharhamel A possible issue with the stub files?

@Kharhamel Kharhamel self-assigned this Aug 20, 2022
@Kharhamel
Copy link
Collaborator

this should be easy to fix, i will just override the types from phpstan

@Kharhamel
Copy link
Collaborator

I keep this issue onpen in case I missed some functions

@Mir-37
Copy link

Mir-37 commented Apr 28, 2023

This issue is still unfixed! And I am failing to use "laravel-notification-channels/webpush" package because of this issue!

@pyrou
Copy link
Author

pyrou commented Apr 28, 2023

It has. Months ago with 2.3
Please be more specific on what's missing or on how this is related to mentioned package. But a dedicated issue would be probably more appropriate

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