1 | <?php |
||
8 | class TimerBox |
||
9 | { |
||
10 | /** |
||
11 | * @var float |
||
12 | */ |
||
13 | protected $time; |
||
14 | |||
15 | /** |
||
16 | * @var SplObjectStorage |
||
17 | */ |
||
18 | protected $timers; |
||
19 | |||
20 | /** |
||
21 | * @var SplPriorityQueue |
||
22 | */ |
||
23 | protected $scheduler; |
||
24 | |||
25 | /** |
||
26 | * |
||
27 | */ |
||
28 | 67 | public function __construct() |
|
33 | |||
34 | /** |
||
35 | * @return float |
||
36 | */ |
||
37 | 48 | public function updateTime() |
|
41 | |||
42 | /** |
||
43 | * @return mixed |
||
44 | */ |
||
45 | 22 | public function getTime() |
|
49 | |||
50 | /** |
||
51 | * @param TimerInterface $timer |
||
52 | * @return bool |
||
53 | */ |
||
54 | 9 | public function contains(TimerInterface $timer) |
|
58 | |||
59 | /** |
||
60 | * @param TimerInterface $timer |
||
61 | */ |
||
62 | 20 | public function add(TimerInterface $timer) |
|
70 | |||
71 | /** |
||
72 | * @param TimerInterface $timer |
||
73 | */ |
||
74 | 6 | public function remove(TimerInterface $timer) |
|
78 | |||
79 | /** |
||
80 | * @return TimerInterface|null |
||
81 | */ |
||
82 | 5 | public function getFirst() |
|
98 | |||
99 | /** |
||
100 | * @return bool |
||
101 | */ |
||
102 | 2 | public function isEmpty() |
|
106 | |||
107 | /** |
||
108 | * |
||
109 | */ |
||
110 | 38 | public function tick() |
|
148 | } |
||
149 |