1 | <?php |
||
7 | class Throttler |
||
8 | { |
||
9 | /** |
||
10 | * @var int |
||
11 | */ |
||
12 | private $maxCount; |
||
13 | /** |
||
14 | * @var \tomzx\Job\JobQueue |
||
15 | */ |
||
16 | private $waitingJobs; |
||
17 | /** |
||
18 | * @var \tomzx\Job\JobQueue |
||
19 | */ |
||
20 | private $runningJobs; |
||
21 | /** |
||
22 | * @var \tomzx\Job\JobQueue |
||
23 | */ |
||
24 | private $completedJobs; |
||
25 | /** |
||
26 | * @var \tomzx\Job\JobQueue |
||
27 | */ |
||
28 | private $eventEmitter; |
||
29 | |||
30 | /** |
||
31 | * @param int $maxCount |
||
32 | * @param int $resolutionMicroSeconds |
||
33 | */ |
||
34 | 8 | public function __construct(int $maxCount, int $resolutionMicroSeconds = 100000) |
|
43 | |||
44 | /** |
||
45 | * @param \tomzx\Job\Job $job |
||
46 | */ |
||
47 | 7 | public function push(Job $job) |
|
53 | |||
54 | /** |
||
55 | * @param \tomzx\Job\Job $job |
||
56 | */ |
||
57 | 2 | public function pushAndStart(Job $job) |
|
63 | |||
64 | 6 | public function wait() |
|
78 | |||
79 | /** |
||
80 | * @return \tomzx\Job\JobQueue |
||
81 | */ |
||
82 | 3 | public function getCompletedJobs() |
|
86 | |||
87 | /** |
||
88 | * @param callable $callback |
||
89 | */ |
||
90 | 1 | public function onJobWaiting(callable $callback) |
|
94 | |||
95 | /** |
||
96 | * @param callable $callback |
||
97 | */ |
||
98 | 1 | public function onJobRunning(callable $callback) |
|
102 | |||
103 | /** |
||
104 | * @param callable $callback |
||
105 | */ |
||
106 | 1 | public function onJobCompleted(callable $callback) |
|
110 | |||
111 | /** |
||
112 | * @return \tomzx\Job\Job|void |
||
113 | */ |
||
114 | 6 | private function tryStart() |
|
132 | |||
133 | /** |
||
134 | * @return bool |
||
135 | */ |
||
136 | 6 | private function runningJobsIsFull() |
|
140 | } |
||
141 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..