Skip to content

Commit 5063150

Browse files
author
Florian Guimier
committed
Fix phpstan
1 parent ade79b9 commit 5063150

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/AbsoluteDate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ private function initDatetime(string $date, string $format): void
215215

216216
try {
217217
$this->datetime = DatePoint::createFromFormat($format, $date, $timezone);
218-
} catch (\DateMalformedStringException) {
219-
throw new ParsingException(sprintf('Cannot parse %s with format %s', $date, $format));
218+
} catch (\DateMalformedStringException $e) {
219+
throw new ParsingException(sprintf('Cannot parse %s with format %s', $date, $format), previous: $e);
220220
}
221221
}
222222

tests/AbsoluteDateTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ public function testWithPointInTime(): void
8585
'2019-12-27 23:00:00',
8686
new \DateTimeZone('UTC')
8787
);
88-
self::assertNotFalse($datetime);
8988

9089
$date = AbsoluteDate::createInTimezone(new \DateTimeZone('UTC'), $datetime);
9190
self::assertSame('2019-12-27', $date->format());

0 commit comments

Comments
 (0)