Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7361374

Browse files
[Clock] Fix MockClock::modify() on PHP 8.3
1 parente6e1e26 commit7361374

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/Symfony/Component/Clock/MockClock.php‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ public function sleep(float|int $seconds): void
4949

5050
publicfunctionmodify(string$modifier):void
5151
{
52-
if (false ===$modifiedNow = @$this->now->modify($modifier)) {
52+
try {
53+
$modifiedNow = @$this->now->modify($modifier);
54+
}catch (\DateMalformedStringException) {
55+
$modifiedNow =false;
56+
}
57+
if (false ===$modifiedNow) {
5358
thrownew \InvalidArgumentException(sprintf('Invalid modifier: "%s". Could not modify MockClock.',$modifier));
5459
}
5560

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp