Skip to content

Commit dcc96af

Browse files
authored
Merge pull request #208 from phpcr/fix-php81-deprecation
fix php 8.1 warnings
2 parents f9b18c1 + f378a6a commit dcc96af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PHPCR/Util/ValueConverter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,13 @@ public function convertType($value, $type, $srcType = PropertyType::UNDEFINED)
246246
try {
247247
return new DateTime($value);
248248
} catch (Exception $e) {
249-
throw new ValueFormatException("String '$value' is not a valid date", null, $e);
249+
throw new ValueFormatException("String '$value' is not a valid date", 0, $e);
250250
}
251251
case PropertyType::LONG:
252252
case PropertyType::DOUBLE:
253253
case PropertyType::DECIMAL:
254254
$datetime = new DateTime();
255-
$datetime = $datetime->setTimestamp($value);
255+
$datetime = $datetime->setTimestamp(round($value));
256256

257257
return $datetime;
258258
}

0 commit comments

Comments
 (0)