Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHP 8.4 and 8.3 to CI Configuration and Update GitHub Actions Versions #70

Merged
merged 4 commits into from
Dec 3, 2024
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
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