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/VFreeBusy.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/VFreeBusy.php')
-rw-r--r-- | vendor/sabre/vobject/lib/Component/VFreeBusy.php | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/vendor/sabre/vobject/lib/Component/VFreeBusy.php b/vendor/sabre/vobject/lib/Component/VFreeBusy.php index 72294cc9f..558a85233 100644 --- a/vendor/sabre/vobject/lib/Component/VFreeBusy.php +++ b/vendor/sabre/vobject/lib/Component/VFreeBusy.php @@ -15,8 +15,8 @@ use Sabre\VObject; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class VFreeBusy extends VObject\Component { - +class VFreeBusy extends VObject\Component +{ /** * Checks based on the contained FREEBUSY information, if a timeslot is * available. @@ -26,19 +26,18 @@ class VFreeBusy extends VObject\Component { * * @return bool */ - function isFree(DateTimeInterface $start, DatetimeInterface $end) { - + public function isFree(DateTimeInterface $start, DatetimeInterface $end) + { foreach ($this->select('FREEBUSY') as $freebusy) { - // We are only interested in FBTYPE=BUSY (the default), // FBTYPE=BUSY-TENTATIVE or FBTYPE=BUSY-UNAVAILABLE. - if (isset($freebusy['FBTYPE']) && strtoupper(substr((string)$freebusy['FBTYPE'], 0, 4)) !== 'BUSY') { + if (isset($freebusy['FBTYPE']) && 'BUSY' !== strtoupper(substr((string) $freebusy['FBTYPE'], 0, 4))) { continue; } // The freebusy component can hold more than 1 value, separated by // commas. - $periods = explode(',', (string)$freebusy); + $periods = explode(',', (string) $freebusy); foreach ($periods as $period) { // Every period is formatted as [start]/[end]. The start is an @@ -55,13 +54,10 @@ class VFreeBusy extends VObject\Component { if ($start < $busyEnd && $end > $busyStart) { return false; } - } - } return true; - } /** @@ -79,24 +75,22 @@ class VFreeBusy extends VObject\Component { * * @var array */ - function getValidationRules() { - + public function getValidationRules() + { return [ - 'UID' => 1, + 'UID' => 1, 'DTSTAMP' => 1, - 'CONTACT' => '?', - 'DTSTART' => '?', - 'DTEND' => '?', + 'CONTACT' => '?', + 'DTSTART' => '?', + 'DTEND' => '?', 'ORGANIZER' => '?', - 'URL' => '?', + 'URL' => '?', - 'ATTENDEE' => '*', - 'COMMENT' => '*', - 'FREEBUSY' => '*', + 'ATTENDEE' => '*', + 'COMMENT' => '*', + 'FREEBUSY' => '*', 'REQUEST-STATUS' => '*', ]; - } - } |