Skip to content

Commit

Permalink
FIX: changed openssl functions typehinting from ressource to OpenSSLC…
Browse files Browse the repository at this point in the history
…ertificate
  • Loading branch information
Kharhamel committed Aug 20, 2022
1 parent 6a4c59f commit 7df7673
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generated/openssl.php
Expand Up @@ -1420,12 +1420,12 @@ function openssl_x509_fingerprint($certificate, string $digest_algo = "sha1", bo
* certificate and returns an OpenSSLCertificate object for
* it.
*
* @param string|resource $certificate X509 certificate. See Key/Certificate parameters for a list of valid values.
* @return resource Returns an OpenSSLCertificate on success.
* @param \OpenSSLCertificate|string $certificate X509 certificate. See Key/Certificate parameters for a list of valid values.
* @return \OpenSSLCertificate Returns an OpenSSLCertificate on success.
* @throws OpensslException
*
*/
function openssl_x509_read($certificate)
function openssl_x509_read($certificate): \OpenSSLCertificate
{
error_clear_last();
$safeResult = \openssl_x509_read($certificate);
Expand Down
1 change: 1 addition & 0 deletions generator/config/CustomPhpStanFunctionMap.php
Expand Up @@ -26,6 +26,7 @@
'curl_share_errno' => ['int', 'share_handle' => 'CurlShareHandle'],
'curl_share_setopt' => ['void', 'share_handle' => 'CurlShareHandle', 'option' => 'int', 'value' => 'mixed'],
'curl_unescape' => ['string', 'handle' => 'CurlHandle', 'string' => 'string'],
'openssl_x509_read' => ['OpenSSLCertificate|false', 'x509certdata'=>'OpenSSLCertificate|string'], // this replace ressource by OpenSSLCertificate
'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
//todo: edit the reader to turn 0|1 into int
'preg_match' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_subpatterns='=>'string[]', 'flags='=>'int', 'offset='=>'int'], //int|false instead of 0|1|false
Expand Down

0 comments on commit 7df7673

Please sign in to comment.