diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb8259f..66346d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,13 +17,18 @@ jobs: php-version: - "8.1" - "8.2" + - "8.3" + - "8.4" dependencies: - "lowest" - "highest" + exclude: + - php-version: "8.4" + dependencies: "lowest" steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" with: fetch-depth: 2 @@ -35,7 +40,7 @@ jobs: ini-values: "zend.assertions=1" - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v2" + uses: "ramsey/composer-install@v3" with: dependency-versions: "${{ matrix.dependencies }}" @@ -43,7 +48,7 @@ jobs: run: "vendor/bin/phpunit --coverage-clover=coverage.xml" - name: "Upload coverage file" - uses: "actions/upload-artifact@v2" + uses: "actions/upload-artifact@v4" with: name: "phpunit-${{ matrix.dependencies }}-${{ matrix.php-version }}.coverage" path: "coverage.xml" @@ -56,17 +61,17 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" with: fetch-depth: 2 - name: "Download coverage files" - uses: "actions/download-artifact@v2" + uses: "actions/download-artifact@v4" with: path: "reports" - name: "Upload to Codecov" - uses: "codecov/codecov-action@v1" + uses: "codecov/codecov-action@v3" with: directory: reports @@ -81,7 +86,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -91,7 +96,7 @@ jobs: tools: "cs2pr" - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v2" + uses: "ramsey/composer-install@v3" - name: "Install php-cs-fixer" run: composer require "friendsofphp/php-cs-fixer:^3.23" diff --git a/lib/promise-adapter/src/Adapter/GuzzleHttpPromiseAdapter.php b/lib/promise-adapter/src/Adapter/GuzzleHttpPromiseAdapter.php index 597eded..2b126ea 100644 --- a/lib/promise-adapter/src/Adapter/GuzzleHttpPromiseAdapter.php +++ b/lib/promise-adapter/src/Adapter/GuzzleHttpPromiseAdapter.php @@ -29,7 +29,7 @@ class GuzzleHttpPromiseAdapter implements PromiseAdapterInterface * * @return Promise */ - public function create(&$resolve = null, &$reject = null, callable $canceller = null) + public function create(&$resolve = null, &$reject = null, ?callable $canceller = null) { $queue = Utils::queue(); $promise = new Promise([$queue, 'run'], $canceller); diff --git a/lib/promise-adapter/src/Adapter/ReactPromiseAdapter.php b/lib/promise-adapter/src/Adapter/ReactPromiseAdapter.php index 5be2069..db247c0 100644 --- a/lib/promise-adapter/src/Adapter/ReactPromiseAdapter.php +++ b/lib/promise-adapter/src/Adapter/ReactPromiseAdapter.php @@ -29,7 +29,7 @@ class ReactPromiseAdapter implements PromiseAdapterInterface * * @return Promise */ - public function create(&$resolve = null, &$reject = null, callable $canceller = null) + public function create(&$resolve = null, &$reject = null, ?callable $canceller = null) { $deferred = new Deferred($canceller); diff --git a/lib/promise-adapter/src/Adapter/WebonyxGraphQLSyncPromiseAdapter.php b/lib/promise-adapter/src/Adapter/WebonyxGraphQLSyncPromiseAdapter.php index 664ffe5..dbf8a65 100644 --- a/lib/promise-adapter/src/Adapter/WebonyxGraphQLSyncPromiseAdapter.php +++ b/lib/promise-adapter/src/Adapter/WebonyxGraphQLSyncPromiseAdapter.php @@ -30,7 +30,7 @@ class WebonyxGraphQLSyncPromiseAdapter implements PromiseAdapterInterface */ private $webonyxPromiseAdapter; - public function __construct(SyncPromiseAdapter $webonyxPromiseAdapter = null) + public function __construct(?SyncPromiseAdapter $webonyxPromiseAdapter = null) { $webonyxPromiseAdapter = $webonyxPromiseAdapter?:new SyncPromiseAdapter(); $this->setWebonyxPromiseAdapter($webonyxPromiseAdapter); @@ -55,7 +55,7 @@ public function setWebonyxPromiseAdapter(SyncPromiseAdapter $webonyxPromiseAdapt /** * {@inheritdoc} */ - public function create(&$resolve = null, &$reject = null, callable $canceller = null) + public function create(&$resolve = null, &$reject = null, ?callable $canceller = null) { $promise = $this->webonyxPromiseAdapter->create(function ($res, $rej) use (&$resolve, &$reject) { $resolve = $res; diff --git a/lib/promise-adapter/src/PromiseAdapterInterface.php b/lib/promise-adapter/src/PromiseAdapterInterface.php index cf67a01..eedc62d 100644 --- a/lib/promise-adapter/src/PromiseAdapterInterface.php +++ b/lib/promise-adapter/src/PromiseAdapterInterface.php @@ -25,7 +25,7 @@ interface PromiseAdapterInterface * * @return TPromise a Promise */ - public function create(&$resolve = null, &$reject = null, callable $canceller = null); + public function create(&$resolve = null, &$reject = null, ?callable $canceller = null); /** * Creates a full filed Promise for a value if the value is not a promise. diff --git a/src/DataLoader.php b/src/DataLoader.php index 2e17b63..c66ae22 100644 --- a/src/DataLoader.php +++ b/src/DataLoader.php @@ -45,7 +45,7 @@ class DataLoader implements DataLoaderInterface */ private $promiseAdapter; - public function __construct(callable $batchLoadFn, PromiseAdapterInterface $promiseFactory, Option $options = null) + public function __construct(callable $batchLoadFn, PromiseAdapterInterface $promiseFactory, ?Option $options = null) { $this->batchLoadFn = $batchLoadFn; $this->promiseAdapter = $promiseFactory; diff --git a/tests/AbuseTest.php b/tests/AbuseTest.php index 63b4756..c163fa8 100644 --- a/tests/AbuseTest.php +++ b/tests/AbuseTest.php @@ -124,7 +124,7 @@ public function testAwaitWithoutNoInstance() * @param callable $batchLoadFn * @return DataLoader */ - private static function idLoader(callable $batchLoadFn = null) + private static function idLoader(?callable $batchLoadFn = null) { if (null === $batchLoadFn) { $batchLoadFn = function ($keys) { diff --git a/tests/DataLoadTest.php b/tests/DataLoadTest.php index b01cb77..fd17e01 100644 --- a/tests/DataLoadTest.php +++ b/tests/DataLoadTest.php @@ -894,7 +894,7 @@ private static function eventLoader() }); } - private static function idLoader(Option $options = null, callable $batchLoadFnCallBack = null) + private static function idLoader(?Option $options = null, ?callable $batchLoadFnCallBack = null) { $loadCalls = new \ArrayObject(); if (null === $batchLoadFnCallBack) {