Skip to content

Commit

Permalink
Merge pull request #70 from KentarouTakeda/php-version
Browse files Browse the repository at this point in the history
Add PHP 8.4 and 8.3 to CI Configuration and Update GitHub Actions Versions
  • Loading branch information
mcg-web authored Dec 3, 2024
2 parents 3a6d9a0 + c4619a3 commit b5016b8
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -35,15 +40,15 @@ 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 }}"

- name: "Run PHPUnit"
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"
Expand All @@ -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

Expand All @@ -81,7 +86,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/promise-adapter/src/Adapter/ReactPromiseAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/promise-adapter/src/PromiseAdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/DataLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/AbuseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tests/DataLoadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b5016b8

Please sign in to comment.