From 74111a3e934584ffeb2ab047d5852c069bf50a5a Mon Sep 17 00:00:00 2001 From: orklah Date: Sun, 6 Nov 2022 21:22:57 +0100 Subject: [PATCH 1/2] adding openssl_x509_verify --- dictionaries/CallMap.php | 1 + dictionaries/CallMap_74_delta.php | 1 + dictionaries/CallMap_80_delta.php | 4 ++++ src/Psalm/Internal/Type/AssertionReconciler.php | 2 ++ 4 files changed, 8 insertions(+) diff --git a/dictionaries/CallMap.php b/dictionaries/CallMap.php index c060b68508c..a5d8fc1e8ef 100644 --- a/dictionaries/CallMap.php +++ b/dictionaries/CallMap.php @@ -9415,6 +9415,7 @@ 'openssl_x509_free' => ['void', 'certificate'=>'OpenSSLCertificate'], 'openssl_x509_parse' => ['array|false', 'certificate'=>'OpenSSLCertificate|string', 'short_names='=>'bool'], 'openssl_x509_read' => ['OpenSSLCertificate|false', 'certificate'=>'OpenSSLCertificate|string'], +'openssl_x509_verify' => ['int', 'certificate'=>'string|OpenSSLCertificate', 'public_key'=>'string|OpenSSLCertificate|OpenSSLAsymmetricKey|array'], 'ord' => ['int', 'character'=>'string'], 'OuterIterator::current' => ['mixed'], 'OuterIterator::getInnerIterator' => ['Iterator'], diff --git a/dictionaries/CallMap_74_delta.php b/dictionaries/CallMap_74_delta.php index af5e0d976bf..6226077179f 100644 --- a/dictionaries/CallMap_74_delta.php +++ b/dictionaries/CallMap_74_delta.php @@ -18,6 +18,7 @@ 'added' => [ 'ReflectionProperty::getType' => ['?ReflectionType'], 'mb_str_split' => ['list|false', 'string'=>'string', 'length='=>'positive-int', 'encoding='=>'string'], + 'openssl_x509_verify' => ['int', 'certificate'=>'string|resource', 'public_key'=>'string|array|resource'], ], 'changed' => [ 'array_merge' => [ diff --git a/dictionaries/CallMap_80_delta.php b/dictionaries/CallMap_80_delta.php index a16d4967141..cd644320157 100644 --- a/dictionaries/CallMap_80_delta.php +++ b/dictionaries/CallMap_80_delta.php @@ -1193,6 +1193,10 @@ 'old' => ['resource|false', 'certificate'=>'string|resource'], 'new' => ['OpenSSLCertificate|false', 'certificate'=>'OpenSSLCertificate|string'], ], + 'openssl_x509_verify' => [ + 'old' => ['int', 'certificate'=>'string|resource', 'public_key'=>'string|array|resource'], + 'new' => ['int', 'certificate'=>'string|OpenSSLCertificate', 'public_key'=>'string|OpenSSLCertificate|OpenSSLAsymmetricKey|array'], + ], 'parse_str' => [ 'old' => ['void', 'string'=>'string', '&w_result='=>'array'], 'new' => ['void', 'string'=>'string', '&w_result'=>'array'], diff --git a/src/Psalm/Internal/Type/AssertionReconciler.php b/src/Psalm/Internal/Type/AssertionReconciler.php index e72954cbaf0..1fa4c5b5965 100644 --- a/src/Psalm/Internal/Type/AssertionReconciler.php +++ b/src/Psalm/Internal/Type/AssertionReconciler.php @@ -81,6 +81,8 @@ public static function reconcile( ?int &$failed_reconciliation = Reconciler::RECONCILIATION_OK, bool $negated = false ): Union { + var_dump($assertion); + var_dump($existing_var_type->getId()); $codebase = $statements_analyzer->getCodebase(); $is_strict_equality = false; From 398cf99c6c8d395443a0136f8bbce83fcdc2ba6f Mon Sep 17 00:00:00 2001 From: orklah Date: Sun, 6 Nov 2022 21:24:03 +0100 Subject: [PATCH 2/2] revert wrong commit --- src/Psalm/Internal/Type/AssertionReconciler.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Psalm/Internal/Type/AssertionReconciler.php b/src/Psalm/Internal/Type/AssertionReconciler.php index 1fa4c5b5965..e72954cbaf0 100644 --- a/src/Psalm/Internal/Type/AssertionReconciler.php +++ b/src/Psalm/Internal/Type/AssertionReconciler.php @@ -81,8 +81,6 @@ public static function reconcile( ?int &$failed_reconciliation = Reconciler::RECONCILIATION_OK, bool $negated = false ): Union { - var_dump($assertion); - var_dump($existing_var_type->getId()); $codebase = $statements_analyzer->getCodebase(); $is_strict_equality = false;