Add phpDoc typehints for magic methods

Signed-off-by: Raul <raul@nextcloud.com>
This commit is contained in:
Raul
2022-05-03 13:00:51 +02:00
committed by Julius Härtl
parent 6ae61368a7
commit 3a730cf38f

View File

@@ -158,6 +158,17 @@ class Card extends RelationalEntity {
return $calendar;
}
public function getDaysUntilDue(): int {
$today = new DateTime();
$today->setTime(0, 0);
$match_date = $this->getDueDateTime() ?? new DateTime();
$match_date->setTime(0, 0);
$diff = $today->diff($match_date);
return (int) $diff->format('%R%a'); // Extract days count in interval
}
public function getCalendarPrefix(): string {
return 'card';
}