File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -38,20 +38,21 @@ public function getTime()
38
38
39
39
public function add (TimerInterface $ timer )
40
40
{
41
- $ id = \spl_object_hash ($ timer );
41
+ $ id = \PHP_VERSION_ID < 70200 ? \ spl_object_hash( $ timer ) : \spl_object_id ($ timer );
42
42
$ this ->timers [$ id ] = $ timer ;
43
43
$ this ->schedule [$ id ] = $ timer ->getInterval () + $ this ->updateTime ();
44
44
$ this ->sorted = false ;
45
45
}
46
46
47
47
public function contains (TimerInterface $ timer )
48
48
{
49
- return isset ($ this ->timers [\spl_object_hash ($ timer )]);
49
+ $ id = \PHP_VERSION_ID < 70200 ? \spl_object_hash ($ timer ) : \spl_object_id ($ timer );
50
+ return isset ($ this ->timers [$ id ]);
50
51
}
51
52
52
53
public function cancel (TimerInterface $ timer )
53
54
{
54
- $ id = \spl_object_hash ($ timer );
55
+ $ id = \PHP_VERSION_ID < 70200 ? \ spl_object_hash( $ timer ) : \spl_object_id ($ timer );
55
56
unset($ this ->timers [$ id ], $ this ->schedule [$ id ]);
56
57
}
57
58
You can’t perform that action at this time.
0 commit comments