@@ -189,9 +189,10 @@ public function defer(callable $callback, $data = null): string
189189 /** @psalm-var Watcher<null> $watcher */
190190 $ watcher = new Watcher ;
191191 $ watcher ->type = Watcher::DEFER ;
192- $ watcher ->id = $ this ->nextId ++ ;
192+ $ watcher ->id = $ this ->nextId ;
193193 $ watcher ->callback = $ callback ;
194194 $ watcher ->data = $ data ;
195+ \PHP_VERSION_ID >= 80300 ? $ this ->nextId = \str_increment ($ this ->nextId ) : ++$ this ->nextId ;
195196
196197 $ this ->watchers [$ watcher ->id ] = $ watcher ;
197198 $ this ->nextTickQueue [$ watcher ->id ] = $ watcher ;
@@ -224,11 +225,12 @@ public function delay(int $delay, callable $callback, $data = null): string
224225 /** @psalm-var Watcher<int> $watcher */
225226 $ watcher = new Watcher ;
226227 $ watcher ->type = Watcher::DELAY ;
227- $ watcher ->id = $ this ->nextId ++ ;
228+ $ watcher ->id = $ this ->nextId ;
228229 $ watcher ->callback = $ callback ;
229230 $ watcher ->value = $ delay ;
230231 $ watcher ->expiration = $ this ->now () + $ delay ;
231232 $ watcher ->data = $ data ;
233+ \PHP_VERSION_ID >= 80300 ? $ this ->nextId = \str_increment ($ this ->nextId ) : ++$ this ->nextId ;
232234
233235 $ this ->watchers [$ watcher ->id ] = $ watcher ;
234236 $ this ->enableQueue [$ watcher ->id ] = $ watcher ;
@@ -261,11 +263,12 @@ public function repeat(int $interval, callable $callback, $data = null): string
261263 /** @psalm-var Watcher<int> $watcher */
262264 $ watcher = new Watcher ;
263265 $ watcher ->type = Watcher::REPEAT ;
264- $ watcher ->id = $ this ->nextId ++ ;
266+ $ watcher ->id = $ this ->nextId ;
265267 $ watcher ->callback = $ callback ;
266268 $ watcher ->value = $ interval ;
267269 $ watcher ->expiration = $ this ->now () + $ interval ;
268270 $ watcher ->data = $ data ;
271+ \PHP_VERSION_ID >= 80300 ? $ this ->nextId = \str_increment ($ this ->nextId ) : ++$ this ->nextId ;
269272
270273 $ this ->watchers [$ watcher ->id ] = $ watcher ;
271274 $ this ->enableQueue [$ watcher ->id ] = $ watcher ;
@@ -297,10 +300,11 @@ public function onReadable($stream, callable $callback, $data = null): string
297300 /** @psalm-var Watcher<resource> $watcher */
298301 $ watcher = new Watcher ;
299302 $ watcher ->type = Watcher::READABLE ;
300- $ watcher ->id = $ this ->nextId ++ ;
303+ $ watcher ->id = $ this ->nextId ;
301304 $ watcher ->callback = $ callback ;
302305 $ watcher ->value = $ stream ;
303306 $ watcher ->data = $ data ;
307+ \PHP_VERSION_ID >= 80300 ? $ this ->nextId = \str_increment ($ this ->nextId ) : ++$ this ->nextId ;
304308
305309 $ this ->watchers [$ watcher ->id ] = $ watcher ;
306310 $ this ->enableQueue [$ watcher ->id ] = $ watcher ;
@@ -332,10 +336,11 @@ public function onWritable($stream, callable $callback, $data = null): string
332336 /** @psalm-var Watcher<resource> $watcher */
333337 $ watcher = new Watcher ;
334338 $ watcher ->type = Watcher::WRITABLE ;
335- $ watcher ->id = $ this ->nextId ++ ;
339+ $ watcher ->id = $ this ->nextId ;
336340 $ watcher ->callback = $ callback ;
337341 $ watcher ->value = $ stream ;
338342 $ watcher ->data = $ data ;
343+ \PHP_VERSION_ID >= 80300 ? $ this ->nextId = \str_increment ($ this ->nextId ) : ++$ this ->nextId ;
339344
340345 $ this ->watchers [$ watcher ->id ] = $ watcher ;
341346 $ this ->enableQueue [$ watcher ->id ] = $ watcher ;
@@ -368,10 +373,11 @@ public function onSignal(int $signo, callable $callback, $data = null): string
368373 /** @psalm-var Watcher<int> $watcher */
369374 $ watcher = new Watcher ;
370375 $ watcher ->type = Watcher::SIGNAL ;
371- $ watcher ->id = $ this ->nextId ++ ;
376+ $ watcher ->id = $ this ->nextId ;
372377 $ watcher ->callback = $ callback ;
373378 $ watcher ->value = $ signo ;
374379 $ watcher ->data = $ data ;
380+ \PHP_VERSION_ID >= 80300 ? $ this ->nextId = \str_increment ($ this ->nextId ) : ++$ this ->nextId ;
375381
376382 $ this ->watchers [$ watcher ->id ] = $ watcher ;
377383 $ this ->enableQueue [$ watcher ->id ] = $ watcher ;
0 commit comments