Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ 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
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
Expand All @@ -25,10 +25,10 @@ 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
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -41,4 +41,4 @@ jobs:
- name: Unit tests
run: |
composer run-script test


6 changes: 3 additions & 3 deletions src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
10 changes: 5 additions & 5 deletions src/Future/BaseFutureTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Future/CompletedFutureValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down