Skip to content

Commit 28d9584

Browse files
authored
Merge pull request #14 from clue-labs/php8.1
Require PHP 8.1+ and add `mixed` type declarations
2 parents c989ee1 + 249f9f6 commit 28d9584

File tree

7 files changed

+10
-36
lines changed

7 files changed

+10
-36
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
/.github/ export-ignore
33
/.gitignore export-ignore
44
/phpunit.xml.dist export-ignore
5-
/phpunit.xml.legacy export-ignore
65
/tests/ export-ignore

.github/workflows/ci.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ jobs:
1212
matrix:
1313
php:
1414
- 8.1
15-
- 8.0
16-
- 7.4
17-
- 7.3
18-
- 7.2
19-
- 7.1
2015
steps:
2116
- uses: actions/checkout@v2
2217
- uses: shivammathur/setup-php@v2
@@ -25,6 +20,3 @@ jobs:
2520
coverage: xdebug
2621
- run: composer install
2722
- run: vendor/bin/phpunit --coverage-text
28-
if: ${{ matrix.php >= 7.3 }}
29-
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
30-
if: ${{ matrix.php < 7.3 }}

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,16 @@ $ composer require react/async:dev-main
338338
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
339339

340340
This project aims to run on any platform and thus does not require any PHP
341-
extensions and supports running on PHP 7.1 through current PHP 8+.
341+
extensions and supports running on PHP 8.1+.
342342
It's *highly recommended to use the latest supported PHP version* for this project.
343343

344344
We're committed to providing long-term support (LTS) options and to provide a
345345
smooth upgrade path. If you're using an older PHP version, you may use the
346-
[`2.x` branch](https://github.com/reactphp/async/tree/2.x) which provides a
347-
compatible API but does not take advantage of newer language features. You may
348-
target both versions at the same time to support a wider range of PHP versions.
346+
[`3.x` branch](https://github.com/reactphp/async/tree/3.x) (PHP 7.1+) or
347+
[`2.x` branch](https://github.com/reactphp/async/tree/2.x) (PHP 5.3+) which both
348+
provide a compatible API but do not take advantage of newer language features.
349+
You may target multiple versions at the same time to support a wider range of
350+
PHP versions.
349351

350352
## Tests
351353

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
}
2727
],
2828
"require": {
29-
"php": ">=7.1",
29+
"php": ">=8.1",
3030
"react/event-loop": "^1.2",
3131
"react/promise": "^2.8 || ^1.2.1"
3232
},
3333
"require-dev": {
34-
"phpunit/phpunit": "^9.3 || ^7.5"
34+
"phpunit/phpunit": "^9.3"
3535
},
3636
"autoload": {
3737
"files": [

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<!-- PHPUnit configuration file with new format for PHPUnit 9.3+ -->
43
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
54
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
65
bootstrap="vendor/autoload.php"

phpunit.xml.legacy

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* @throws \Throwable when the promise is rejected with a `Throwable`
5151
* @throws \UnexpectedValueException when the promise is rejected with an unexpected value (Promise API v1 or v2 only)
5252
*/
53-
function await(PromiseInterface $promise)
53+
function await(PromiseInterface $promise): mixed
5454
{
5555
$wait = true;
5656
$resolved = null;
@@ -212,7 +212,7 @@ function ($error) use (&$exception, &$rejected, &$wait) {
212212
* @return PromiseInterface<mixed>
213213
* @since 3.0.0
214214
*/
215-
function coroutine(callable $function, ...$args): PromiseInterface
215+
function coroutine(callable $function, mixed ...$args): PromiseInterface
216216
{
217217
try {
218218
$generator = $function(...$args);

0 commit comments

Comments
 (0)