Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
50 | protected function delayUntilNextRequest(): int |
||
51 | { |
||
52 | $currentTimeFrameStart = $this->deferrer->getCurrentTime() - $this->timeFrameLengthInMilliseconds(); |
||
53 | |||
54 | $requestsInCurrentTimeFrame = array_values(array_filter( |
||
55 | $this->store->get(), |
||
56 | function (int $timestamp) use ($currentTimeFrameStart) { |
||
57 | return $timestamp >= $currentTimeFrameStart; |
||
58 | } |
||
59 | )); |
||
60 | |||
61 | if (count($requestsInCurrentTimeFrame) < $this->limit) { |
||
62 | return 0; |
||
63 | } |
||
64 | |||
65 | $oldestRequestStartTimeRelativeToCurrentTimeFrame = |
||
66 | $this->deferrer->getCurrentTime() - $requestsInCurrentTimeFrame[0]; |
||
67 | |||
68 | return $this->timeFrameLengthInMilliseconds() - $oldestRequestStartTimeRelativeToCurrentTimeFrame; |
||
69 | } |
||
70 | |||
80 |
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..