Skip to content

Commit 7df7673

Browse files
committed
FIX: changed openssl functions typehinting from ressource to OpenSSLCertificate
1 parent 6a4c59f commit 7df7673

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

generated/openssl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,12 +1420,12 @@ function openssl_x509_fingerprint($certificate, string $digest_algo = "sha1", bo
14201420
* certificate and returns an OpenSSLCertificate object for
14211421
* it.
14221422
*
1423-
* @param string|resource $certificate X509 certificate. See Key/Certificate parameters for a list of valid values.
1424-
* @return resource Returns an OpenSSLCertificate on success.
1423+
* @param \OpenSSLCertificate|string $certificate X509 certificate. See Key/Certificate parameters for a list of valid values.
1424+
* @return \OpenSSLCertificate Returns an OpenSSLCertificate on success.
14251425
* @throws OpensslException
14261426
*
14271427
*/
1428-
function openssl_x509_read($certificate)
1428+
function openssl_x509_read($certificate): \OpenSSLCertificate
14291429
{
14301430
error_clear_last();
14311431
$safeResult = \openssl_x509_read($certificate);

generator/config/CustomPhpStanFunctionMap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
'curl_share_errno' => ['int', 'share_handle' => 'CurlShareHandle'],
2727
'curl_share_setopt' => ['void', 'share_handle' => 'CurlShareHandle', 'option' => 'int', 'value' => 'mixed'],
2828
'curl_unescape' => ['string', 'handle' => 'CurlHandle', 'string' => 'string'],
29+
'openssl_x509_read' => ['OpenSSLCertificate|false', 'x509certdata'=>'OpenSSLCertificate|string'], // this replace ressource by OpenSSLCertificate
2930
'fgetcsv' => ['array|false|null', 'fp'=>'resource', 'length='=>'0|positive-int', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'], //phpstan default return type is too hard to analyse
3031
//todo: edit the reader to turn 0|1 into int
3132
'preg_match' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_subpatterns='=>'string[]', 'flags='=>'int', 'offset='=>'int'], //int|false instead of 0|1|false

0 commit comments

Comments
 (0)