| Conditions | 5 |
| Paths | 3 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function modify(AbstractQuery $query) |
||
| 41 | { |
||
| 42 | foreach ($query->getParameters() as $parameter) { |
||
| 43 | if ($parameter instanceof Parameter && |
||
| 44 | ($value = $parameter->getValue()) && |
||
| 45 | $value instanceof \DateTimeInterface |
||
| 46 | ) { |
||
| 47 | // round down so that the results do not include data that should not be there. |
||
| 48 | $uts = (int) (floor($value->getTimestamp() / $this->roundSeconds) * $this->roundSeconds); |
||
| 49 | $date = (new \DateTimeImmutable('now', $value->getTimezone()))->setTimestamp($uts); |
||
| 50 | |||
| 51 | $query->setParameter($parameter->getName(), $date, $parameter->getType()); |
||
| 52 | } |
||
| 53 | } |
||
| 54 | } |
||
| 55 | } |
||
| 56 |