From 2d9d4fdeb8dbe717d9d513eb54e8496611822d34 Mon Sep 17 00:00:00 2001 From: Masaki Kawaguchi Date: Sat, 7 Dec 2024 19:54:29 +0900 Subject: [PATCH 1/5] add test envionment --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4b4e04..8b16f66 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - php-version: [7.4, 8.0, 8.1] + php-version: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4] steps: - name: Checkout @@ -41,4 +41,4 @@ jobs: - name: Unit tests run: | composer run-script test - \ No newline at end of file + From 853ec912324c0740a4fd4cfe82f7a8a760a595f3 Mon Sep 17 00:00:00 2001 From: Masaki Kawaguchi Date: Sat, 7 Dec 2024 19:54:38 +0900 Subject: [PATCH 2/5] Deprecate implicitly nullable parameter types --- src/Core.php | 6 +++--- src/Future/BaseFutureTrait.php | 10 +++++----- src/Future/CompletedFutureValue.php | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Core.php b/src/Core.php index dd7d1a0..fd9554b 100644 --- a/src/Core.php +++ b/src/Core.php @@ -333,9 +333,9 @@ public static function doSleep(array $request) */ public static function proxy( FutureArrayInterface $future, - callable $onFulfilled = null, - callable $onRejected = null, - callable $onProgress = null + ?callable $onFulfilled = null, + ?callable $onRejected = null, + ?callable $onProgress = null ) { return new FutureArray( $future->then($onFulfilled, $onRejected, $onProgress), diff --git a/src/Future/BaseFutureTrait.php b/src/Future/BaseFutureTrait.php index 30465e7..bae5d33 100644 --- a/src/Future/BaseFutureTrait.php +++ b/src/Future/BaseFutureTrait.php @@ -39,8 +39,8 @@ trait BaseFutureTrait */ public function __construct( PromiseInterface $promise, - callable $wait = null, - callable $cancel = null + ?callable $wait = null, + ?callable $cancel = null ) { $this->wrappedPromise = $promise; $this->waitfn = $wait; @@ -81,9 +81,9 @@ public function promise() * @return PromiseInterface */ public function then( - callable $onFulfilled = null, - callable $onRejected = null, - callable $onProgress = null + ?callable $onFulfilled = null, + ?callable $onRejected = null, + ?callable $onProgress = null ) { return $this->wrappedPromise->then($onFulfilled, $onRejected, $onProgress); } diff --git a/src/Future/CompletedFutureValue.php b/src/Future/CompletedFutureValue.php index 7a4e226..1eb321b 100644 --- a/src/Future/CompletedFutureValue.php +++ b/src/Future/CompletedFutureValue.php @@ -20,7 +20,7 @@ class CompletedFutureValue implements FutureInterface * @param \Exception $e Error. Pass a GuzzleHttp\Ring\Exception\CancelledFutureAccessException * to mark the future as cancelled. */ - public function __construct($result, \Exception $e = null) + public function __construct($result, ?\Exception $e = null) { $this->result = $result; $this->error = $e; @@ -58,9 +58,9 @@ public function promise() * @return PromiseInterface */ public function then( - callable $onFulfilled = null, - callable $onRejected = null, - callable $onProgress = null + ?callable $onFulfilled = null, + ?callable $onRejected = null, + ?callable $onProgress = null ) { return $this->promise()->then($onFulfilled, $onRejected, $onProgress); } From d1d51738b079ac4d131b223dfb82af9d8b9aa083 Mon Sep 17 00:00:00 2001 From: Masaki Kawaguchi Date: Sat, 7 Dec 2024 19:59:51 +0900 Subject: [PATCH 3/5] update action package --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8b16f66..87bc97c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Use PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 From 516c97ee63d3f257bf514ee740f8494eb4001296 Mon Sep 17 00:00:00 2001 From: Masaki Kawaguchi Date: Sat, 7 Dec 2024 20:05:10 +0900 Subject: [PATCH 4/5] remove deprecated set-output --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 87bc97c..960ffb8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: - name: Get composer cache directory id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies uses: actions/cache@v2 From b1a16f13e8e6de8b6bf5fe022e57335b45c67e10 Mon Sep 17 00:00:00 2001 From: Masaki Kawaguchi Date: Sat, 7 Dec 2024 20:06:31 +0900 Subject: [PATCH 5/5] update latest --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 960ffb8..b4c9cdc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.composercache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}