diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-04-25 08:52:50 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2019-04-25 08:52:50 +0200 |
commit | e779335d060b3a51d6a144d23af4097ae6801473 (patch) | |
tree | 2427765313f715a0e5b48228abe5200cb82b787f /vendor/sabre/vobject/lib/Component/VAvailability.php | |
parent | e937e8fff96a935b14a479c062f6b0d00b90b99d (diff) | |
download | volse-hubzilla-e779335d060b3a51d6a144d23af4097ae6801473.tar.gz volse-hubzilla-e779335d060b3a51d6a144d23af4097ae6801473.tar.bz2 volse-hubzilla-e779335d060b3a51d6a144d23af4097ae6801473.zip |
update composer libs
Diffstat (limited to 'vendor/sabre/vobject/lib/Component/VAvailability.php')
-rw-r--r-- | vendor/sabre/vobject/lib/Component/VAvailability.php | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/vendor/sabre/vobject/lib/Component/VAvailability.php b/vendor/sabre/vobject/lib/Component/VAvailability.php index 66b3310c5..6f3e7f13c 100644 --- a/vendor/sabre/vobject/lib/Component/VAvailability.php +++ b/vendor/sabre/vobject/lib/Component/VAvailability.php @@ -15,8 +15,8 @@ use Sabre\VObject; * @author Ivan Enderlin * @license http://sabre.io/license/ Modified BSD License */ -class VAvailability extends VObject\Component { - +class VAvailability extends VObject\Component +{ /** * Returns true or false depending on if the event falls in the specified * time-range. This is used for filtering purposes. @@ -31,14 +31,14 @@ class VAvailability extends VObject\Component { * * @return bool */ - function isInTimeRange(DateTimeInterface $start, DateTimeInterface $end) { - + public function isInTimeRange(DateTimeInterface $start, DateTimeInterface $end) + { list($effectiveStart, $effectiveEnd) = $this->getEffectiveStartEnd(); - return ( + + return (is_null($effectiveStart) || $start < $effectiveEnd) && (is_null($effectiveEnd) || $end > $effectiveStart) - ); - + ; } /** @@ -53,8 +53,8 @@ class VAvailability extends VObject\Component { * * @return array */ - function getEffectiveStartEnd() { - + public function getEffectiveStartEnd() + { $effectiveStart = null; $effectiveEnd = null; @@ -68,10 +68,8 @@ class VAvailability extends VObject\Component { } return [$effectiveStart, $effectiveEnd]; - } - /** * A simple list of validation rules. * @@ -87,31 +85,30 @@ class VAvailability extends VObject\Component { * * @var array */ - function getValidationRules() { - + public function getValidationRules() + { return [ - 'UID' => 1, + 'UID' => 1, 'DTSTAMP' => 1, - 'BUSYTYPE' => '?', - 'CLASS' => '?', - 'CREATED' => '?', - 'DESCRIPTION' => '?', - 'DTSTART' => '?', + 'BUSYTYPE' => '?', + 'CLASS' => '?', + 'CREATED' => '?', + 'DESCRIPTION' => '?', + 'DTSTART' => '?', 'LAST-MODIFIED' => '?', - 'ORGANIZER' => '?', - 'PRIORITY' => '?', - 'SEQUENCE' => '?', - 'SUMMARY' => '?', - 'URL' => '?', - 'DTEND' => '?', - 'DURATION' => '?', + 'ORGANIZER' => '?', + 'PRIORITY' => '?', + 'SEQUENCE' => '?', + 'SUMMARY' => '?', + 'URL' => '?', + 'DTEND' => '?', + 'DURATION' => '?', 'CATEGORIES' => '*', - 'COMMENT' => '*', - 'CONTACT' => '*', + 'COMMENT' => '*', + 'CONTACT' => '*', ]; - } /** @@ -138,19 +135,18 @@ class VAvailability extends VObject\Component { * * @return array */ - function validate($options = 0) { - + public function validate($options = 0) + { $result = parent::validate($options); if (isset($this->DTEND) && isset($this->DURATION)) { $result[] = [ - 'level' => 3, + 'level' => 3, 'message' => 'DTEND and DURATION cannot both be present', - 'node' => $this + 'node' => $this, ]; } return $result; - } } |