[Pkg-owncloud-commits] [php-sabre-vobject] 45/341: Merge branch '3.3'
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 13:35:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabre-vobject.
commit b914cf931ddf2991022bc30cc00a8a2fef541a2d
Merge: 180fccb 5c8f5a1
Author: Evert Pot <me at evertpot.com>
Date: Fri Jan 9 19:53:45 2015 -0500
Merge branch '3.3'
Conflicts:
lib/Component.php
lib/Component/VCalendar.php
lib/Component/VCard.php
lib/ITip/Broker.php
lib/Property/ICalendar/DateTime.php
ChangeLog.md | 7 ++
lib/Component.php | 8 +-
lib/Component/VCalendar.php | 66 ++++++++++--
lib/Component/VCard.php | 40 ++++---
lib/ITip/Broker.php | 3 +-
lib/Node.php | 21 ++++
lib/Parser/MimeDir.php | 6 +-
lib/Property/ICalendar/DateTime.php | 19 +++-
lib/VCardConverter.php | 2 +-
tests/VObject/Component/VCalendarTest.php | 150 ++++++++++++++++++++++++++
tests/VObject/Component/VCardTest.php | 112 +++++++++++++++++++
tests/VObject/ITip/BrokerProcessReplyTest.php | 9 +-
tests/VObject/JCalTest.php | 8 ++
tests/VObject/VCardConverterTest.php | 77 +++++++++----
14 files changed, 472 insertions(+), 56 deletions(-)
diff --cc lib/Component/VCalendar.php
index 4a10a9a,9d17e20..17956cc
--- a/lib/Component/VCalendar.php
+++ b/lib/Component/VCalendar.php
@@@ -34,7 -34,7 +34,7 @@@ class VCalendar extends VObject\Documen
*
* @var array
*/
- static public $componentMap = [
- static $componentMap = array(
++ static $componentMap = [
'VALARM' => 'Sabre\\VObject\\Component\\VAlarm',
'VEVENT' => 'Sabre\\VObject\\Component\\VEvent',
'VFREEBUSY' => 'Sabre\\VObject\\Component\\VFreeBusy',
@@@ -48,7 -48,7 +48,7 @@@
*
* @var array
*/
- static public $valueMap = [
- static $valueMap = array(
++ static $valueMap = [
'BINARY' => 'Sabre\\VObject\\Property\\Binary',
'BOOLEAN' => 'Sabre\\VObject\\Property\\Boolean',
'CAL-ADDRESS' => 'Sabre\\VObject\\Property\\ICalendar\\CalAddress',
@@@ -71,7 -71,7 +71,7 @@@
*
* @var array
*/
- static public $propertyMap = [
- static $propertyMap = array(
++ static $propertyMap = [
// Calendar properties
'CALSCALE' => 'Sabre\\VObject\\Property\\FlatText',
'METHOD' => 'Sabre\\VObject\\Property\\FlatText',
@@@ -393,16 -405,20 +405,20 @@@
}
- $uidList = array();
+ $uidList = [];
$componentsFound = 0;
+
- $componentTypes = array();
++ $componentTypes = [];
+
foreach($this->children as $child) {
if($child instanceof Component) {
$componentsFound++;
- if (!in_array($child->name, array('VEVENT', 'VTODO', 'VJOURNAL'))) {
+ if (!in_array($child->name, ['VEVENT', 'VTODO', 'VJOURNAL'])) {
continue;
}
+ $componentTypes[] = $child->name;
$uid = (string)$child->UID;
$isMaster = isset($child->{'RECURRENCE-ID'})?0:1;
@@@ -431,9 -447,41 +447,41 @@@
'level' => 3,
'message' => 'An iCalendar object must have at least 1 component.',
'node' => $this,
- );
+ ];
}
+ if ($options & self::PROFILE_CALDAV) {
+ if (count($uidList)>1) {
- $warnings[] = array(
++ $warnings[] = [
+ 'level' => 3,
+ 'message' => 'A calendar object on a CalDAV server may only have components with the same UID.',
+ 'node' => $this,
- );
++ ];
+ }
+ if (count(array_unique($componentTypes))===0) {
- $warnings[] = array(
++ $warnings[] = [
+ 'level' => 3,
+ 'message' => 'A calendar object on a CalDAV server must have at least 1 component (VTODO, VEVENT, VJOURNAL).',
+ 'node' => $this,
- );
++ ];
+ }
+ if (count(array_unique($componentTypes))>1) {
- $warnings[] = array(
++ $warnings[] = [
+ 'level' => 3,
+ 'message' => 'A calendar object on a CalDAV server may only have 1 type of component (VEVENT, VTODO or VJOURNAL).',
+ 'node' => $this,
- );
++ ];
+ }
+
+ if (isset($this->METHOD)) {
- $warnings[] = array(
++ $warnings[] = [
+ 'level' => 3,
+ 'message' => 'A calendar object on a CalDAV server MUST NOT have a METHOD property.',
+ 'node' => $this,
- );
++ ];
+ }
+ }
+
return $warnings;
}
diff --cc lib/Component/VCard.php
index ea508d0,e468801..39c8cbe
--- a/lib/Component/VCard.php
+++ b/lib/Component/VCard.php
@@@ -330,18 -350,9 +350,8 @@@ class VCard extends VObject\Document
// FN is commented out, because it's already handled by the
// validate function, which may also try to repair it.
// 'FN' => '+',
--
- // vcard actually specifies this as '?', but in most cases not
- // having a UID is highly undesirable. So here we're going against
- // the spec and make it required.
- //
- // I would be interested to hear if this is problematic for
- // anyone, or at least a usecase where this is undesirable.
- //
- // If so, I may have to add a facility that allows us to check
- // specifically for validity in the context of 'DAV'.
- 'UID' => '1',
+ 'UID' => '?',
- );
+ ];
}
diff --cc lib/ITip/Broker.php
index d6248dc,aefe9fb..44ff41d
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@@ -340,8 -340,8 +340,8 @@@ class Broker
if (!$existingObject) {
return null;
}
- $instances = array();
+ $instances = [];
- $requestStatus = '2.0;Success';
+ $requestStatus = '2.0';
// Finding all the instances the attendee replied to.
foreach($itipMessage->message->VEVENT as $vevent) {
diff --cc lib/Property/ICalendar/DateTime.php
index 373aa5d,47dc34b..ea9ec09
--- a/lib/Property/ICalendar/DateTime.php
+++ b/lib/Property/ICalendar/DateTime.php
@@@ -260,12 -274,13 +276,13 @@@ class DateTime extends Property
$dts = $this->getDateTimes();
$hasTime = $this->hasTime();
+ $isFloating = $this->isFloating();
$tz = $dts[0]->getTimeZone();
- $isUtc = in_array($tz->getName() , ['UTC', 'GMT', 'Z']);
- $isUtc = $isFloating ? false : in_array($tz->getName() , array('UTC', 'GMT', 'Z'));
++ $isUtc = $isFloating ? false : in_array($tz->getName() , ['UTC', 'GMT', 'Z']);
return array_map(
- function($dt) use ($hasTime, $isUtc) {
+ function(DateTimeInterface $dt) use ($hasTime, $isUtc) {
if ($hasTime) {
return $dt->format('Y-m-d\\TH:i:s') . ($isUtc?'Z':'');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git
More information about the Pkg-owncloud-commits
mailing list