Skip to content

Commit aa37ff6

Browse files
authored
Merge pull request #125 from phil-davis/changes-for-5.1-series
Changes for 5.1 series
2 parents d7da228 + 2413496 commit aa37ff6

File tree

9 files changed

+18
-21
lines changed

9 files changed

+18
-21
lines changed

.gitattributes

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
/examples export-ignore
2-
/tests export-ignore
1+
/.github/ export-ignore
2+
/examples/ export-ignore
3+
/tests/ export-ignore
34
/.gitattributes export-ignore
45
/.gitignore export-ignore
5-
/.travis.yml export-ignore
6+
/.php_cs.dist export-ignore
67
/CHANGELOG.md export-ignore
78
/README.md export-ignore
89
/_config.yml export-ignore
9-
/phpunit.xml.dist export-ignore
10+
/phpstan.neon export-ignore

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
15+
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
1616
coverage: ['pcov']
1717
code-analysis: ['no']
1818
include:
@@ -21,7 +21,7 @@ jobs:
2121
code-analysis: 'yes'
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2525

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

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

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

6161
- name: Code Coverage
62-
uses: codecov/codecov-action@v2
62+
uses: codecov/codecov-action@v4
6363
if: matrix.coverage != 'none'

bin/.empty

Whitespace-only changes.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"require-dev": {
4949
"friendsofphp/php-cs-fixer": "~2.17.1",
5050
"phpstan/phpstan": "^0.12",
51-
"phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0"
51+
"phpunit/phpunit" : "^7.5 || ^8.5 || ^9.6"
5252
},
5353
"scripts": {
5454
"phpstan": [

examples/curl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function curl_multi_loop_scheduler($mh, callable $done)
102102
break;
103103

104104
default:
105-
throw Exception('Curl error: '.curl_multi_strerror($mrc));
105+
throw new Exception('Curl error: '.curl_multi_strerror($mrc));
106106
}
107107
}
108108

lib/Loop/Loop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ protected function runTimers()
265265
* If $timeout is 0, it will return immediately. If $timeout is null, it
266266
* will wait indefinitely.
267267
*
268-
* @param float|null timeout
268+
* @param float|null $timeout
269269
*/
270270
protected function runStreams($timeout)
271271
{

lib/Promise.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ public function wait()
219219
* This method makes sure that the result of these callbacks are handled
220220
* correctly, and any chained promises are also correctly fulfilled or
221221
* rejected.
222-
*
223-
* @param callable $callBack
224222
*/
225223
private function invokeCallback(Promise $subPromise, callable $callBack = null)
226224
{

lib/coroutine.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
*
4343
* });
4444
*
45-
* @return \Sabre\Event\Promise
46-
*
4745
* @psalm-template TReturn
4846
* @psalm-param callable():\Generator<mixed, mixed, mixed, TReturn> $gen
4947
* @psalm-return Promise<TReturn>

tests/Event/CoroutineTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testRejectedPromise()
5656
// This line is unreachable, but it's our control
5757
$start += 4;
5858
} catch (\Exception $e) {
59-
$start += $e->getMessage();
59+
$start += (int) $e->getMessage();
6060
}
6161
});
6262

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

@@ -115,13 +115,13 @@ public function testRejectedPromiseAsync()
115115
// This line is unreachable, but it's our control
116116
$start += 4;
117117
} catch (\Exception $e) {
118-
$start += $e->getMessage();
118+
$start += (int) $e->getMessage();
119119
}
120120
});
121121

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

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

127127
$this->assertEquals(3, $start);
@@ -156,7 +156,7 @@ public function testDeepException()
156156

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

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

162162
$this->assertEquals(3, $start);

0 commit comments

Comments
 (0)