Skip to content

Commit 52e5da9

Browse files
committed
PHP 7.1
1 parent 84a2de5 commit 52e5da9

File tree

6 files changed

+10
-22
lines changed

6 files changed

+10
-22
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ jobs:
1717
- 7.3
1818
- 7.2
1919
- 7.1
20-
- 5.6
21-
- 5.5
22-
- 5.4
23-
- 5.3
2420
steps:
2521
- uses: actions/checkout@v2
2622
- uses: shivammathur/setup-php@v2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ $ composer require react/async:dev-main
222222
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
223223

224224
This project aims to run on any platform and thus does not require any PHP
225-
extensions and supports running on legacy PHP 5.3 through current PHP 8+.
225+
extensions and supports running on PHP 7.1 through current PHP 8+.
226226
It's *highly recommended to use the latest supported PHP version* for this project.
227227

228228
## Tests

composer.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
}
2727
],
2828
"require": {
29-
"php": ">=5.3.2",
29+
"php": ">=7.1",
3030
"react/event-loop": "^1.2",
3131
"react/promise": "^2.8 || ^1.2.1"
3232
},
3333
"require-dev": {
34-
"phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35"
34+
"phpunit/phpunit": "^9.3 || ^5.7"
3535
},
3636
"suggest": {
3737
"react/event-loop": "You need an event loop for this to make sense."
@@ -43,10 +43,5 @@
4343
},
4444
"autoload-dev": {
4545
"psr-4": { "React\\Tests\\Async\\": "tests/" }
46-
},
47-
"extra": {
48-
"branch-alias": {
49-
"dev-master": "1.0-dev"
50-
}
5146
}
5247
}

phpunit.xml.legacy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!-- PHPUnit configuration file with old format for PHPUnit 9.2 or older -->
44
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
77
colors="true">
88
<testsuites>

src/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* @param PromiseInterface $promise
4545
* @return mixed returns whatever the promise resolves to
4646
* @throws \Exception when the promise is rejected with an `Exception`
47-
* @throws \Throwable when the promise is rejected with a `Throwable` (PHP 7+)
47+
* @throws \Throwable when the promise is rejected with a `Throwable`
4848
* @throws \UnexpectedValueException when the promise is rejected with an unexpected value (Promise API v1 or v2 only)
4949
*/
5050
function await(PromiseInterface $promise)
@@ -78,7 +78,7 @@ function ($error) use (&$exception, &$rejected, &$wait) {
7878

7979
if ($rejected) {
8080
// promise is rejected with an unexpected value (Promise API v1 or v2 only)
81-
if (!$exception instanceof \Exception && !$exception instanceof \Throwable) {
81+
if (!$exception instanceof \Throwable) {
8282
$exception = new \UnexpectedValueException(
8383
'Promise rejected with unexpected value of type ' . (is_object($exception) ? get_class($exception) : gettype($exception))
8484
);

tests/AwaitTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWith
4646
React\Async\await($promise);
4747
}
4848

49-
/**
50-
* @requires PHP 7
51-
*/
5249
public function testAwaitThrowsErrorWhenPromiseIsRejectedWithError()
5350
{
5451
$promise = new Promise(function ($_, $reject) {
@@ -84,8 +81,8 @@ public function testAwaitReturnsValueWhenPromiseIsFulfilledEvenWhenOtherTimerSto
8481

8582
public function testAwaitShouldNotCreateAnyGarbageReferencesForResolvedPromise()
8683
{
87-
if (class_exists('React\Promise\When') && PHP_VERSION_ID >= 50400) {
88-
$this->markTestSkipped('Not supported on legacy Promise v1 API with PHP 5.4+');
84+
if (class_exists('React\Promise\When')) {
85+
$this->markTestSkipped('Not supported on legacy Promise v1 API');
8986
}
9087

9188
gc_collect_cycles();
@@ -126,8 +123,8 @@ public function testAwaitShouldNotCreateAnyGarbageReferencesForPromiseRejectedWi
126123
$this->markTestSkipped('Promises must be rejected with a \Throwable instance since Promise v3');
127124
}
128125

129-
if (class_exists('React\Promise\When') && PHP_VERSION_ID >= 50400) {
130-
$this->markTestSkipped('Not supported on legacy Promise v1 API with PHP 5.4+');
126+
if (class_exists('React\Promise\When')) {
127+
$this->markTestSkipped('Not supported on legacy Promise v1 API');
131128
}
132129

133130
gc_collect_cycles();

0 commit comments

Comments
 (0)