File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 85
85
- name : Setup PHP
86
86
uses : shivammathur/setup-php@v2
87
87
with :
88
- php-version : 7.4
88
+ php-version : 8.1
89
89
tools : composer
90
90
coverage : xdebug
91
91
Original file line number Diff line number Diff line change 11
11
}
12
12
],
13
13
"require" : {
14
- "php" : " ^7.1|^8.0 " ,
14
+ "php" : " ^8.1 " ,
15
15
"php-http/httplug" : " ^2.0" ,
16
16
"react/http" : " ^1.0" ,
17
17
"react/event-loop" : " ^1.2" ,
18
18
"php-http/discovery" : " ^1.0" ,
19
- "phpunit/phpunit " : " ^9.3.11 || ^7 "
19
+ "react/async " : " ^4 "
20
20
},
21
21
"require-dev" : {
22
22
"php-http/client-integration-tests" : " ^3.0" ,
23
23
"php-http/message" : " ^1.0" ,
24
+ "phpunit/phpunit" : " ^9.5" ,
24
25
"nyholm/psr7" : " ^1.3"
25
26
},
26
27
"provide" : {
Original file line number Diff line number Diff line change 11
11
use React \Promise \PromiseInterface ;
12
12
use RuntimeException ;
13
13
14
+ use function React \Async \await ;
15
+
14
16
/**
15
17
* React promise adapter implementation.
16
18
*
@@ -114,12 +116,9 @@ public function getState()
114
116
*/
115
117
public function wait ($ unwrap = true )
116
118
{
117
- $ loop = $ this ->loop ;
118
- while (HttpPromise::PENDING === $ this ->getState ()) {
119
- $ loop ->futureTick (function () use ($ loop ) {
120
- $ loop ->stop ();
121
- });
122
- $ loop ->run ();
119
+ try {
120
+ await ($ this ->promise );
121
+ } catch (\Throwable ) {
123
122
}
124
123
125
124
if ($ unwrap ) {
You can’t perform that action at this time.
0 commit comments