From f1c07977809ce3221286d53e99f0d91145b1166f Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 25 Apr 2019 11:24:09 +0200 Subject: Revert "update composer libs" This reverts commit e779335d060b3a51d6a144d23af4097ae6801473 --- vendor/sabre/vobject/lib/Component/VTodo.php | 101 +++++++++++++++------------ 1 file changed, 55 insertions(+), 46 deletions(-) (limited to 'vendor/sabre/vobject/lib/Component/VTodo.php') diff --git a/vendor/sabre/vobject/lib/Component/VTodo.php b/vendor/sabre/vobject/lib/Component/VTodo.php index 9de77e841..144ced694 100644 --- a/vendor/sabre/vobject/lib/Component/VTodo.php +++ b/vendor/sabre/vobject/lib/Component/VTodo.php @@ -14,8 +14,8 @@ use Sabre\VObject; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class VTodo extends VObject\Component -{ +class VTodo extends VObject\Component { + /** * Returns true or false depending on if the event falls in the specified * time-range. This is used for filtering purposes. @@ -28,8 +28,8 @@ class VTodo extends VObject\Component * * @return bool */ - public function isInTimeRange(DateTimeInterface $start, DateTimeInterface $end) - { + function isInTimeRange(DateTimeInterface $start, DateTimeInterface $end) { + $dtstart = isset($this->DTSTART) ? $this->DTSTART->getDateTime() : null; $duration = isset($this->DURATION) ? VObject\DateTimeParser::parseDuration($this->DURATION) : null; $due = isset($this->DUE) ? $this->DUE->getDateTime() : null; @@ -39,7 +39,6 @@ class VTodo extends VObject\Component if ($dtstart) { if ($duration) { $effectiveEnd = $dtstart->add($duration); - return $start <= $effectiveEnd && $end > $dtstart; } elseif ($due) { return @@ -50,7 +49,7 @@ class VTodo extends VObject\Component } } if ($due) { - return $start < $due && $end >= $due; + return ($start < $due && $end >= $due); } if ($completed && $created) { return @@ -58,13 +57,13 @@ class VTodo extends VObject\Component ($end >= $created || $end >= $completed); } if ($completed) { - return $start <= $completed && $end >= $completed; + return ($start <= $completed && $end >= $completed); } if ($created) { - return $end > $created; + return ($end > $created); } - return true; + } /** @@ -82,44 +81,45 @@ class VTodo extends VObject\Component * * @var array */ - public function getValidationRules() - { + function getValidationRules() { + return [ - 'UID' => 1, + 'UID' => 1, 'DTSTAMP' => 1, - 'CLASS' => '?', - 'COMPLETED' => '?', - 'CREATED' => '?', - 'DESCRIPTION' => '?', - 'DTSTART' => '?', - 'GEO' => '?', + 'CLASS' => '?', + 'COMPLETED' => '?', + 'CREATED' => '?', + 'DESCRIPTION' => '?', + 'DTSTART' => '?', + 'GEO' => '?', 'LAST-MODIFIED' => '?', - 'LOCATION' => '?', - 'ORGANIZER' => '?', - 'PERCENT' => '?', - 'PRIORITY' => '?', + 'LOCATION' => '?', + 'ORGANIZER' => '?', + 'PERCENT' => '?', + 'PRIORITY' => '?', 'RECURRENCE-ID' => '?', - 'SEQUENCE' => '?', - 'STATUS' => '?', - 'SUMMARY' => '?', - 'URL' => '?', + 'SEQUENCE' => '?', + 'STATUS' => '?', + 'SUMMARY' => '?', + 'URL' => '?', - 'RRULE' => '?', - 'DUE' => '?', + 'RRULE' => '?', + 'DUE' => '?', 'DURATION' => '?', - 'ATTACH' => '*', - 'ATTENDEE' => '*', - 'CATEGORIES' => '*', - 'COMMENT' => '*', - 'CONTACT' => '*', - 'EXDATE' => '*', + 'ATTACH' => '*', + 'ATTENDEE' => '*', + 'CATEGORIES' => '*', + 'COMMENT' => '*', + 'CONTACT' => '*', + 'EXDATE' => '*', 'REQUEST-STATUS' => '*', - 'RELATED-TO' => '*', - 'RESOURCES' => '*', - 'RDATE' => '*', + 'RELATED-TO' => '*', + 'RESOURCES' => '*', + 'RDATE' => '*', ]; + } /** @@ -144,29 +144,36 @@ class VTodo extends VObject\Component * * @return array */ - public function validate($options = 0) - { + function validate($options = 0) { + $result = parent::validate($options); if (isset($this->DUE) && isset($this->DTSTART)) { + $due = $this->DUE; $dtStart = $this->DTSTART; if ($due->getValueType() !== $dtStart->getValueType()) { + $result[] = [ - 'level' => 3, + 'level' => 3, 'message' => 'The value type (DATE or DATE-TIME) must be identical for DUE and DTSTART', - 'node' => $due, + 'node' => $due, ]; + } elseif ($due->getDateTime() < $dtStart->getDateTime()) { + $result[] = [ - 'level' => 3, + 'level' => 3, 'message' => 'DUE must occur after DTSTART', - 'node' => $due, + 'node' => $due, ]; + } + } return $result; + } /** @@ -174,11 +181,13 @@ class VTodo extends VObject\Component * * @return array */ - protected function getDefaults() - { + protected function getDefaults() { + return [ - 'UID' => 'sabre-vobject-'.VObject\UUIDUtil::getUUID(), + 'UID' => 'sabre-vobject-' . VObject\UUIDUtil::getUUID(), 'DTSTAMP' => date('Ymd\\THis\\Z'), ]; + } + } -- cgit v1.2.3