diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php index 0128dc8defd..c481e36f95b 100644 --- a/lib/private/Comments/Comment.php +++ b/lib/private/Comments/Comment.php @@ -351,13 +351,9 @@ class Comment implements IComment { } /** - * sets the date of the most recent child - * - * @param \DateTime $dateTime - * @return IComment - * @since 9.0.0 + * @inheritDoc */ - public function setLatestChildDateTime(\DateTime $dateTime = null) { + public function setLatestChildDateTime(?\DateTime $dateTime = null) { $this->data['latestChildDT'] = $dateTime; return $this; } diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index 50b5fabc6a2..b82df1bccc8 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -170,7 +170,6 @@ class Manager implements ICommentsManager { if ($comment->getId() === '') { $comment->setChildrenCount(0); - $comment->setLatestChildDateTime(new \DateTime('0000-00-00 00:00:00', new \DateTimeZone('UTC'))); $comment->setLatestChildDateTime(null); } diff --git a/lib/public/Comments/IComment.php b/lib/public/Comments/IComment.php index 44d294bb07c..eb696fa5f06 100644 --- a/lib/public/Comments/IComment.php +++ b/lib/public/Comments/IComment.php @@ -230,11 +230,11 @@ interface IComment { /** * sets the date of the most recent child * - * @param \DateTime $dateTime + * @param \DateTime|null $dateTime * @return IComment * @since 9.0.0 */ - public function setLatestChildDateTime(\DateTime $dateTime); + public function setLatestChildDateTime(?\DateTime $dateTime = null); /** * returns the object type the comment is attached to