[Pkg-owncloud-commits] [php-sabredav] 09/148: CS

David Prévot taffit at moszumanska.debian.org
Wed Apr 15 01:37:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit c3f4b017749951ceabe1c09288fa2dbe3404e812
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Wed Dec 17 01:20:42 2014 -0500

    CS
---
 lib/CalDAV/Xml/Property/Invite.php                 | 35 ++++++++++++----------
 .../Xml/Property/SupportedCalendarComponentSet.php | 22 ++++++++------
 2 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/lib/CalDAV/Xml/Property/Invite.php b/lib/CalDAV/Xml/Property/Invite.php
index f40a813..7cea45d 100644
--- a/lib/CalDAV/Xml/Property/Invite.php
+++ b/lib/CalDAV/Xml/Property/Invite.php
@@ -17,9 +17,9 @@ use
  * namespace.
  *
  * @see https://trac.calendarserver.org/browser/CalendarServer/trunk/doc/Extensions/caldav-sharing-02.txt
- * @copyright Copyright (C) 2007-2013 Rooftop Solutions. All rights reserved.
- * @author Evert Pot (http://www.rooftopsolutions.nl/)
- * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved.
+ * @author Evert Pot (http://evertpot.com/)
+ * @license http://sabre.io/license/ Modified BSD License
  */
 class Invite implements Element {
 
@@ -64,7 +64,7 @@ class Invite implements Element {
      *
      * @param array $users
      */
-    public function __construct(array $users, array $organizer = null) {
+    function __construct(array $users, array $organizer = null) {
 
         $this->users = $users;
         $this->organizer = $organizer;
@@ -76,28 +76,32 @@ class Invite implements Element {
      *
      * @return array
      */
-    public function getValue() {
+    function getValue() {
 
         return $this->users;
 
     }
 
     /**
-     * The serialize method is called during xml writing.
+     * The xmlSerialize metod is called during xml writing.
      *
-     * It should use the $writer argument to encode this object into XML.
+     * Use the $writer argument to write its own xml serialization.
      *
-     * Important note: it is not needed to create the parent element. The
-     * parent element is already created, and we only have to worry about
-     * attributes, child elements and text (if any).
+     * An important note: do _not_ create a parent element. Any element
+     * implementing XmlSerializble should only ever write what's considered
+     * its 'inner xml'.
      *
-     * Important note 2: If you are writing any new elements, you are also
-     * responsible for closing them.
+     * The parent of the current element is responsible for writing a
+     * containing element.
+     *
+     * This allows serializers to be re-used for different element names.
+     *
+     * If you are opening new elements, you must also close them again.
      *
      * @param Writer $writer
      * @return void
      */
-    public function serializeXml(Writer $writer) {
+    function xmlSerialize(Writer $writer) {
 
         $cs = '{' . Plugin::NS_CALENDARSERVER . '}';
 
@@ -156,7 +160,7 @@ class Invite implements Element {
 
             $writer->endElement(); //user
 
-       }
+        }
 
     }
 
@@ -181,7 +185,7 @@ class Invite implements Element {
      * @param Reader $reader
      * @return mixed
      */
-    static public function deserializeXml(Reader $reader) {
+    static function xmlDeserialize(Reader $reader) {
 
         $cs = '{' . Plugin::NS_CALENDARSERVER . '}';
 
@@ -246,5 +250,4 @@ class Invite implements Element {
         return new self($users);
 
     }
-
 }
diff --git a/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php b/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php
index c69bbea..3094bf1 100644
--- a/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php
+++ b/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php
@@ -55,29 +55,33 @@ class SupportedCalendarComponentSet implements Element {
     }
 
     /**
-     * The serialize method is called during xml writing.
+     * The xmlSerialize metod is called during xml writing.
      *
-     * It should use the $writer argument to encode this object into XML.
+     * Use the $writer argument to write its own xml serialization.
      *
-     * Important note: it is not needed to create the parent element. The
-     * parent element is already created, and we only have to worry about
-     * attributes, child elements and text (if any).
+     * An important note: do _not_ create a parent element. Any element
+     * implementing XmlSerializble should only ever write what's considered
+     * its 'inner xml'.
      *
-     * Important note 2: If you are writing any new elements, you are also
-     * responsible for closing them.
+     * The parent of the current element is responsible for writing a
+     * containing element.
+     *
+     * This allows serializers to be re-used for different element names.
+     *
+     * If you are opening new elements, you must also close them again.
      *
      * @param Writer $writer
      * @return void
      */
     function xmlSerialize(Writer $writer) {
 
-       foreach($this->components as $component) {
+        foreach($this->components as $component) {
 
             $writer->startElement('{' . Plugin::NS_CALDAV . '}comp');
             $writer->writeAttributes(['name' => $component]);
             $writer->endElement();
 
-       }
+        }
 
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list