Skip to content

Commit aab07e7

Browse files
authored
@bradymiller: php 8.2 fix - date is being flagged as not valid even if valid (#197)
1 parent 657c754 commit aab07e7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Rule/Datetime.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ protected function checkDate($dateTime, $format, $value)
9292
{
9393
$equal = (string) $dateTime->format($format) === (string) $value;
9494

95-
if ($dateTime->getLastErrors()['warning_count'] === 0 && $equal) {
95+
$warningCount = $dateTime->getLastErrors()['warning_count'] ?? 0;
96+
if ($warningCount === 0 && $equal) {
9697
return $dateTime;
9798
}
9899
return false;

0 commit comments

Comments
 (0)