[Pkg-owncloud-commits] [php-sabre-vobject] 191/341: Update API documentation.

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:35:46 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 c66f42833116eb0b4d96f32397f3f02c1c8f8d26
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Thu Jan 22 11:52:53 2015 +0100

    Update API documentation.
---
 lib/Parser/XML.php | 64 +++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 44 insertions(+), 20 deletions(-)

diff --git a/lib/Parser/XML.php b/lib/Parser/XML.php
index b8085df..5ed2efe 100644
--- a/lib/Parser/XML.php
+++ b/lib/Parser/XML.php
@@ -117,9 +117,9 @@ class XML extends Parser {
     }
 
     /**
-     * Parse a vCalendar.
+     * Parse a xCalendar component.
      *
-     * @param Sabre\VObject\Component $parentComponent
+     * @param Component $parentComponent
      * @return void
      */
     protected function parseVCalendarComponents(Component $parentComponent) {
@@ -130,7 +130,7 @@ class XML extends Parser {
 
                 case 'properties':
                     $this->pointer = &$children['value'];
-                    $this->parseProperty($parentComponent);
+                    $this->parseProperties($parentComponent);
                     break;
 
                 case 'components':
@@ -143,19 +143,25 @@ class XML extends Parser {
     }
 
     /**
-     * Parse a vCard.
+     * Parse a xCard component.
      *
-     * @param Sabre\VObject\Component $parentComponent
+     * @param Component $parentComponent
      * @return void
      */
     protected function parseVCardComponents(Component $parentComponent) {
 
         $this->pointer = &$this->pointer['value'];
-        $this->parseProperty($parentComponent);
+        $this->parseProperties($parentComponent);
 
     }
 
-    protected function parseProperty(Component $parentComponent) {
+    /**
+     * Parse xCalendar and xCard properties.
+     *
+     * @param Component $parentComponent
+     * @return void
+     */
+    protected function parseProperties(Component $parentComponent) {
 
         foreach ($this->pointer as $xmlProperty) {
 
@@ -166,6 +172,7 @@ class XML extends Parser {
             $propertyParameters = [];
             $propertyType       = 'text';
 
+            // A property which is not part of the standard.
             if (   $namespace !== self::XCAL_NAMESPACE
                 && $namespace !== self::XCARD_NAMESPACE) {
 
@@ -191,6 +198,7 @@ class XML extends Parser {
                 continue;
             }
 
+            // Collect parameters.
             foreach ($xmlProperty['value'] as $i => $xmlPropertyChild) {
 
                 if (   !is_array($xmlPropertyChild)
@@ -286,19 +294,12 @@ class XML extends Parser {
 
     }
 
-    protected function createProperty(Component $parentComponent, $name, $parameters, $type, $value) {
-
-        $property = $this->root->createProperty(
-            $name,
-            null,
-            $parameters,
-            $type
-        );
-        $parentComponent->add($property);
-        $property->setXmlValue($value);
-
-    }
-
+    /**
+     * Parse a component.
+     *
+     * @param Component $parentComponent
+     * @return void
+     */
     protected function parseComponent(Component $parentComponent) {
 
         $components = $this->pointer['value'] ?: [];
@@ -322,6 +323,29 @@ class XML extends Parser {
     }
 
     /**
+     * Create a property.
+     *
+     * @param Component $parentComponent
+     * @param string $name
+     * @param array $parameters
+     * @param string $type
+     * @param mixed $value
+     * @return void
+     */
+    protected function createProperty(Component $parentComponent, $name, $parameters, $type, $value) {
+
+        $property = $this->root->createProperty(
+            $name,
+            null,
+            $parameters,
+            $type
+        );
+        $parentComponent->add($property);
+        $property->setXmlValue($value);
+
+    }
+
+    /**
      * Sets the input data.
      *
      * @param resource|string $input

-- 
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