From 63f7551ae73b1515bf9587dd045370ec1c3e96cc Mon Sep 17 00:00:00 2001 From: overtrue Date: Sat, 5 Mar 2022 22:32:18 +0800 Subject: [PATCH] Fix phpstan issues. --- src/Pay/Client.php | 2 ++ src/Pay/ResponseValidator.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Pay/Client.php b/src/Pay/Client.php index bd89e7b04..37563fe4a 100644 --- a/src/Pay/Client.php +++ b/src/Pay/Client.php @@ -130,7 +130,9 @@ public static function createMockClient(MockHttpClient $mockHttpClient): HttpCli { $mockMerchant = new Merchant( 'mch_id', + /** @phpstan-ignore-next-line*/ \Mockery::mock(PrivateKey::class), + /** @phpstan-ignore-next-line*/ \Mockery::mock(PublicKey::class), 'mock-v3-key', 'mock-v2-key', diff --git a/src/Pay/ResponseValidator.php b/src/Pay/ResponseValidator.php index 608e13291..0070ca2db 100644 --- a/src/Pay/ResponseValidator.php +++ b/src/Pay/ResponseValidator.php @@ -62,7 +62,7 @@ public function validate(ResponseInterface $response): void if (false === \openssl_verify( $message, \base64_decode($signature), - $publicKey, + \strval($publicKey), \OPENSSL_ALGO_SHA256 )) { throw new BadResponseException('Invalid Signature', $response);