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

Changes for 5.1 series #125

Merged
merged 11 commits into from
Jul 24, 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
9 changes: 5 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/examples export-ignore
/tests export-ignore
/.github/ export-ignore
/examples/ export-ignore
/tests/ export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.php_cs.dist export-ignore
/CHANGELOG.md export-ignore
/README.md export-ignore
/_config.yml export-ignore
/phpunit.xml.dist export-ignore
/phpstan.neon export-ignore
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
coverage: ['pcov']
code-analysis: ['no']
include:
Expand All @@ -21,7 +21,7 @@ jobs:
code-analysis: 'yes'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
Expand All @@ -33,10 +33,10 @@ jobs:

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
Expand All @@ -59,5 +59,5 @@ jobs:
run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml

- name: Code Coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
if: matrix.coverage != 'none'
Empty file removed bin/.empty
Empty file.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.17.1",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0"
"phpunit/phpunit" : "^7.5 || ^8.5 || ^9.6"
},
"scripts": {
"phpstan": [
Expand Down
2 changes: 1 addition & 1 deletion examples/curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function curl_multi_loop_scheduler($mh, callable $done)
break;

default:
throw Exception('Curl error: '.curl_multi_strerror($mrc));
throw new Exception('Curl error: '.curl_multi_strerror($mrc));
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Loop/Loop.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ protected function runTimers()
* If $timeout is 0, it will return immediately. If $timeout is null, it
* will wait indefinitely.
*
* @param float|null timeout
* @param float|null $timeout
*/
protected function runStreams($timeout)
{
Expand Down
2 changes: 0 additions & 2 deletions lib/Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ public function wait()
* This method makes sure that the result of these callbacks are handled
* correctly, and any chained promises are also correctly fulfilled or
* rejected.
*
* @param callable $callBack
*/
private function invokeCallback(Promise $subPromise, callable $callBack = null)
{
Expand Down
2 changes: 0 additions & 2 deletions lib/coroutine.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
*
* });
*
* @return \Sabre\Event\Promise
*
* @psalm-template TReturn
* @psalm-param callable():\Generator<mixed, mixed, mixed, TReturn> $gen
* @psalm-return Promise<TReturn>
Expand Down
10 changes: 5 additions & 5 deletions tests/Event/CoroutineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testRejectedPromise()
// This line is unreachable, but it's our control
$start += 4;
} catch (\Exception $e) {
$start += $e->getMessage();
$start += (int) $e->getMessage();
}
});

Expand All @@ -78,7 +78,7 @@ public function testRejectedPromiseException()
// This line is unreachable, but it's our control
$start += 4;
} catch (\LogicException $e) {
$start += $e->getMessage();
$start += (int) $e->getMessage();
}
});

Expand Down Expand Up @@ -115,13 +115,13 @@ public function testRejectedPromiseAsync()
// This line is unreachable, but it's our control
$start += 4;
} catch (\Exception $e) {
$start += $e->getMessage();
$start += (int) $e->getMessage();
}
});

$this->assertEquals(1, $start);

$promise->reject(new \Exception((string) 2));
$promise->reject(new \Exception('2'));
Loop\run();

$this->assertEquals(3, $start);
Expand Down Expand Up @@ -156,7 +156,7 @@ public function testDeepException()

$this->assertEquals(1, $start);

$promise->reject(new \Exception((string) 2));
$promise->reject(new \Exception('2'));
Loop\run();

$this->assertEquals(3, $start);
Expand Down