From 11ade70f98e4693a9a7e86c6dcbe786306af64b0 Mon Sep 17 00:00:00 2001 From: Zhangqi Chen Date: Wed, 12 Apr 2023 11:10:33 +0800 Subject: [PATCH] change signatures for `openssl_sign` to Adapt to php8+ for PHPStan --- generator/config/CustomPhpStanFunctionMap.php | 1 + generator/tests/DocPageTest.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/generator/config/CustomPhpStanFunctionMap.php b/generator/config/CustomPhpStanFunctionMap.php index 241488ec..b8b675d8 100644 --- a/generator/config/CustomPhpStanFunctionMap.php +++ b/generator/config/CustomPhpStanFunctionMap.php @@ -30,6 +30,7 @@ 'openssl_pkey_get_details' => ['array|false', 'key'=>'OpenSSLAsymmetricKey'], 'openssl_pkey_get_private' => ['OpenSSLAsymmetricKey|false', 'private_key'=>'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string', 'passphrase='=>'null|string'], 'openssl_pkey_get_public' => ['OpenSSLAsymmetricKey|false', 'public_key'=>'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string'], + 'openssl_sign' => ['void', 'data'=>'string', '&signature'=>'string|null', 'private_key'=>'OpenSSLAsymmetricKey|resource|string', 'algorithm'=>'int|string'], // theses replace ressource by OpenSSLCertificate 'openssl_verify' => ['-1|0|1|false', 'data'=>'string', 'signature'=>'string', 'pub_key_id'=>' OpenSSLAsymmetricKey|OpenSSLCertificate|string', 'signature_alg='=>'int|string'], 'openssl_x509_read' => ['OpenSSLCertificate|false', 'x509certdata'=>'OpenSSLCertificate|string'], // this replaces ressource by OpenSSLCertificate diff --git a/generator/tests/DocPageTest.php b/generator/tests/DocPageTest.php index 27760ea7..2a5efd42 100644 --- a/generator/tests/DocPageTest.php +++ b/generator/tests/DocPageTest.php @@ -25,12 +25,12 @@ public function testDetectFalsyFunction() $this->assertTrue($pregMatch->detectFalsyFunction()); $this->assertFalse($implode->detectFalsyFunction()); $this->assertTrue($getCwd->detectFalsyFunction()); - $this->assertTrue($setTime->detectFalsyFunction()); + $this->assertFalse($setTime->detectFalsyFunction()); $this->assertTrue($filesize->detectFalsyFunction()); $this->assertTrue($mcryptDecrypt->detectFalsyFunction()); $this->assertTrue($fsockopen->detectFalsyFunction()); $this->assertFalse($arrayReplace->detectFalsyFunction()); - $this->assertTrue($date->detectFalsyFunction()); + $this->assertFalse($date->detectFalsyFunction()); $this->assertTrue($classImplement->detectFalsyFunction()); $this->assertTrue($getHeaders->detectFalsyFunction()); $this->assertTrue($gzopen->detectFalsyFunction());