We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c3f9b41 + eacea7f commit 2f9301cCopy full SHA for 2f9301c
src/Symfony/Component/Clock/MockClock.php
@@ -51,7 +51,12 @@ public function sleep(float|int $seconds): void
51
52
public function modify(string $modifier): void
53
{
54
- if (false === $modifiedNow = @$this->now->modify($modifier)) {
+ try {
55
+ $modifiedNow = @$this->now->modify($modifier);
56
+ } catch (\DateMalformedStringException) {
57
+ $modifiedNow = false;
58
+ }
59
+ if (false === $modifiedNow) {
60
throw new \InvalidArgumentException(sprintf('Invalid modifier: "%s". Could not modify MockClock.', $modifier));
61
}
62
0 commit comments