File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 27
27
"satooshi/php-coveralls" : " ~1.0" ,
28
28
"phpunit/phpcov" : " ^3.1" ,
29
29
"phpunit/phpunit" : " ^5.7" ,
30
- "react/event-loop" : " ^0.4.2"
30
+ "react/event-loop" : " ^1.0 || ^0.5 || ^ 0.4.2"
31
31
},
32
32
"suggest" : {
33
33
"react/event-loop" : " Used for scheduling async operations"
Original file line number Diff line number Diff line change 18
18
// Change scheduler for here
19
19
$ timer = $ loop ->addTimer (0.001 , $ handler );
20
20
21
- return new CallbackDisposable (function () use ($ timer ) {
21
+ return new CallbackDisposable (function () use ($ loop , $ timer ) {
22
22
// And change scheduler for here
23
23
if ($ timer ) {
24
- $ timer -> cancel ( );
24
+ $ loop -> cancelTimer ( $ timer );
25
25
}
26
26
});
27
27
});
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ public function __construct($timerCallableOrLoop)
29
29
$ this ->delayCallback = $ timerCallableOrLoop instanceof LoopInterface ?
30
30
function ($ ms , $ callable ) use ($ timerCallableOrLoop ) {
31
31
$ timer = $ timerCallableOrLoop ->addTimer ($ ms / 1000 , $ callable );
32
- return new CallbackDisposable (function () use ($ timer ) {
33
- $ timer -> cancel ( );
32
+ return new CallbackDisposable (function () use ($ timer, $ timerCallableOrLoop ) {
33
+ $ timerCallableOrLoop -> cancelTimer ( $ timer );
34
34
});
35
35
} :
36
36
$ timerCallableOrLoop ;
Original file line number Diff line number Diff line change @@ -147,8 +147,8 @@ public function testScheduledItemsFromOutsideOfSchedulerDontCreateExtraTimers()
147
147
$ timersExecuted ++;
148
148
$ action ();
149
149
});
150
- return new CallbackDisposable (function () use ($ timer ) {
151
- $ timer -> cancel ( );
150
+ return new CallbackDisposable (function () use ($ loop , $ timer ) {
151
+ $ loop -> cancelTimer ( $ timer );
152
152
});
153
153
});
154
154
@@ -176,8 +176,8 @@ public function testMultipleSchedulesFromOutsideInSameTickDontCreateExtraTimers(
176
176
$ timersExecuted ++;
177
177
$ action ();
178
178
});
179
- return new CallbackDisposable (function () use ($ timer ) {
180
- $ timer -> cancel ( );
179
+ return new CallbackDisposable (function () use ($ loop , $ timer ) {
180
+ $ loop -> cancelTimer ( $ timer );
181
181
});
182
182
});
183
183
@@ -206,8 +206,8 @@ public function testThatStuffScheduledWayInTheFutureDoesntKeepTheLoopRunningIfDi
206
206
$ timersExecuted ++;
207
207
$ action ();
208
208
});
209
- return new CallbackDisposable (function () use ($ timer ) {
210
- $ timer -> cancel ( );
209
+ return new CallbackDisposable (function () use ($ loop , $ timer ) {
210
+ $ loop -> cancelTimer ( $ timer );
211
211
});
212
212
});
213
213
You can’t perform that action at this time.
0 commit comments