-
Notifications
You must be signed in to change notification settings - Fork 656
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
Add support for new types (like CurlHandle) in PHP8 #3824
Comments
Hey @xPaw, can you reproduce the issue on https://psalm.dev ? |
Yes. |
Would also be great to introduce a warning for functions like |
One potential solution I thought of for analyzing forward compatibility would be to add a type such as
|
|
I found these snippets: https://psalm.dev/r/d9103abb4b<?php
class Secret
{
private \OpenSSLAsymmetricKey $key;
public function __construct(string $pk, string $passphrase)
{
if (!$key = openssl_pkey_get_private($pk, $passphrase)) {
throw new InvalidArgumentException('Unable to load DKIM private key: '.openssl_error_string());
}
$this->key = $key;
}
public function getKey(): \OpenSSLAsymmetricKey
{
return $this->key;
}
}
|
@orklah afaik this is implemented already now? (ticket can be closed?) |
Looks like we still need:
|
In the current version (Psalm 4.26.0) I still get false-positives for PHP 8.0:
It is the same message for all CURL related classes and constants (e.g. CURLOPT_URL). |
@derrabus OpenSSL snippet now does not produce errors: https://psalm.dev/r/d9103abb4b |
I found these snippets: https://psalm.dev/r/d9103abb4b<?php
class Secret
{
private \OpenSSLAsymmetricKey $key;
public function __construct(string $pk, string $passphrase)
{
if (!$key = openssl_pkey_get_private($pk, $passphrase)) {
throw new InvalidArgumentException('Unable to load DKIM private key: '.openssl_error_string());
}
$this->key = $key;
}
public function getKey(): \OpenSSLAsymmetricKey
{
return $this->key;
}
}
|
https://github.com/php/php-src/blob/master/UPGRADING
curl_init()
will now return aCurlHandle
object rather than a resource.curl_multi_init()
will now return aCurlMultiHandle
object rather than a resource.curl_share_init()
will now return aCurlShareHandle
object rather than a resource.shmop_open()
will now return aShmop
object rather than a resource.enchant_broker_init()
will now return anEnchantBroker
object rather than a resource.msg_get_queue()
will now return anSysvMessageQueue
object rather than a resource.sem_get()
will now return anSysvSemaphore
object rather than a resource.shm_attach()
will now return anSysvSharedMemory
object rather than a resource.xml_parser_create(_ns
) will now return anXmlParser
object rather than a resource.inflate_init()
will now return anInflateContext
object rather than a resource.deflate_init()
will now return aDeflateContext
object rather than a resource.openssl_x509_read()
andopenssl_csr_sign()
will now return anOpenSSLCertificate
object rather than a resource.openssl_csr_new()
will now return anOpenSSLCertificateSigningRequest
object rather than a resource.openssl_pkey_new()
will now return anOpenSSLAsymmetricKey
object rather than a resource.Socket
object rather than a resource.socket_addrinfo_lookup()
will now return an array ofAddressInfo
objects rather than resources.All the related functions that previous took
resource
now take the object.is_resource
does not work on them.If I understand correctly, a CallMap delta for 8.0 needs to be created?
The text was updated successfully, but these errors were encountered: