From e44a736c6d209ca94e98acad86906ee155fe8d28 Mon Sep 17 00:00:00 2001 From: James ZHNAG Date: Tue, 21 Nov 2023 13:47:56 +0800 Subject: [PATCH] PHP8.3 support --- .github/workflows/ci.yml | 6 +++--- CHANGELOG.md | 6 +++++- README.md | 2 +- bin/CertificateDownloader.php | 2 -- composer.json | 2 +- phpunit.xml.dist | 1 - src/ClientDecoratorInterface.php | 2 +- tests/BuilderTest.php | 3 --- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1858fcd..604a0b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + php-version: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] os: [ubuntu-latest, macOS-latest, windows-latest] runs-on: ${{ matrix.os }} steps: @@ -86,8 +86,8 @@ jobs: id: phpstan-php-7_2-8_1 - run: vendor/bin/phpstan analyse --no-progress --memory-limit=-1 -c phpstan.v8.2.neon - if: matrix.php-version == '8.2' - id: phpstan-php-8_2 + if: 8.1 < matrix.php-version && matrix.php-version < '8.4' + id: phpstan-php-8_2-8_3 - run: | make keygen diff --git a/CHANGELOG.md b/CHANGELOG.md index 98822ad..3cb3792 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # 变更历史 -## [1.4.8](../../compare/v1.4.7...v1.4.8) - 2023-01-01 +## [1.4.9](../../compare/v1.4.8...v1.4.9) - 2023-11-21 + +- 支持PHP8.3运行时 + +## [1.4.8](../../compare/v1.4.7...v1.4.8) - 2023-01-05 - 新增海外账单下载`/v3/global/statements`应答特殊处理逻辑; diff --git a/README.md b/README.md index 5a2e143..685d4e5 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ ## 项目状态 -当前版本为 `1.4.8` 测试版本。 +当前版本为 `1.4.9` 测试版本。 项目版本遵循 [语义化版本号](https://semver.org/lang/zh-CN/)。 如果你使用的版本 `<=v1.3.2`,升级前请参考 [升级指南](UPGRADING.md)。 diff --git a/bin/CertificateDownloader.php b/bin/CertificateDownloader.php index 81f3459..10838e8 100755 --- a/bin/CertificateDownloader.php +++ b/bin/CertificateDownloader.php @@ -57,7 +57,6 @@ public function run(): void private static function certsInjector(string $apiv3Key, array &$certs): callable { return static function(ResponseInterface $response) use ($apiv3Key, &$certs): ResponseInterface { $body = (string) $response->getBody(); - /** @var object{data:array} $json */ $json = \json_decode($body); $data = \is_object($json) && isset($json->data) && \is_array($json->data) ? $json->data : []; \array_map(static function($row) use ($apiv3Key, &$certs) { @@ -119,7 +118,6 @@ private function job(array $opts): void private static function certsRecorder(string $outputDir, array &$certs): callable { return static function(ResponseInterface $response) use ($outputDir, &$certs): ResponseInterface { $body = (string) $response->getBody(); - /** @var object{data:array} $json */ $json = \json_decode($body); $data = \is_object($json) && isset($json->data) && \is_array($json->data) ? $json->data : []; \array_walk($data, static function($row, $index, $certs) use ($outputDir) { diff --git a/composer.json b/composer.json index d160f5a..b4c5a15 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "wechatpay/wechatpay", - "version": "1.4.8", + "version": "1.4.9", "description": "[A]Sync Chainable WeChatPay v2&v3's OpenAPI SDK for PHP", "type": "library", "keywords": [ diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d19e681..334ea26 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,7 +3,6 @@ backupGlobals="false" backupStaticAttributes="false" colors="true" - convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" diff --git a/src/ClientDecoratorInterface.php b/src/ClientDecoratorInterface.php index d80cf6b..b7a7993 100644 --- a/src/ClientDecoratorInterface.php +++ b/src/ClientDecoratorInterface.php @@ -14,7 +14,7 @@ interface ClientDecoratorInterface /** * @var string - This library version */ - public const VERSION = '1.4.8'; + public const VERSION = '1.4.9'; /** * @var string - The HTTP transfer `xml` based protocol diff --git a/tests/BuilderTest.php b/tests/BuilderTest.php index 05bb0a6..8f627ca 100644 --- a/tests/BuilderTest.php +++ b/tests/BuilderTest.php @@ -24,9 +24,6 @@ class BuilderTest extends TestCase public function testConstractor(): void { - if (method_exists($this, 'expectError')) { - $this->expectError(); - } // for PHPUnit8+ if (method_exists($this, 'expectExceptionMessageMatches')) { $this->expectExceptionMessageMatches('#^Call to private#');