Skip to content

Commit b9be93e

Browse files
author
Florian Guimier
committed
Fix phpstan
1 parent e2ae478 commit b9be93e

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
@@ -216,8 +216,8 @@ private function initDatetime(string $date, string $format): void
216216

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

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)