| Conditions | 5 |
| Paths | 8 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | 6 | public function getRequestsSince(\DateTime $date = null) |
|
| 38 | { |
||
| 39 | 6 | $start = $date ? $date->getTimestamp() : 0; |
|
| 40 | |||
| 41 | 6 | $requests = []; |
|
| 42 | 6 | foreach ($this->requests as $time => $reqs) { |
|
| 43 | 6 | if ($time >= $start) { |
|
| 44 | 4 | foreach ($reqs as $req) { |
|
| 45 | 6 | array_unshift($requests, [$time, $req]); |
|
| 46 | } |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | 6 | return $requests; |
|
| 51 | } |
||
| 52 | } |
||
| 53 |