[Pkg-owncloud-commits] [php-sabre-vobject] 53/341: !xml Reorganize the algorithm.

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:35:33 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 5ac4149ef591db0826302572df1c1192e77dd593
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Mon Nov 17 15:26:50 2014 +0100

    !xml Reorganize the algorithm.
---
 lib/Parser/XML.php | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/lib/Parser/XML.php b/lib/Parser/XML.php
index 1225b24..10eb852 100644
--- a/lib/Parser/XML.php
+++ b/lib/Parser/XML.php
@@ -81,10 +81,12 @@ class XML extends Parser {
                     foreach($xmlProperties as $xmlProperty) {
 
                         // Property.
-                        $propertyName = static::getTagName($xmlProperty['name']);
-                        $property     = $this->root->createProperty(
+                        $propertyName        = static::getTagName($xmlProperty['name']);
+                        $xmlPropertyChildren = $xmlProperty['value'];
+                        $property            = $this->root->createProperty(
                             $propertyName
                         );
+                        $parentComponent->add($property);
 
                         /*
                         switch($propertyName) {
@@ -108,14 +110,14 @@ class XML extends Parser {
                         }
                         */
 
-                        foreach($xmlProperty['value'] as $xmlPropertyChildren) {
+                        foreach($xmlPropertyChildren as $xmlPropertyChild) {
 
-                            $xmlPropertyName = static::getTagName($xmlPropertyChildren['name']);
+                            $xmlPropertyChildName = static::getTagName($xmlPropertyChild['name']);
 
                             // Parameters.
-                            if('parameters' === $xmlPropertyName) {
+                            if('parameters' === $xmlPropertyChildName) {
 
-                                $xmlParameters = $xmlPropertyChildren['value'];
+                                $xmlParameters = $xmlPropertyChild['value'];
 
                                 foreach($xmlParameters as $xmlParameter) {
 
@@ -129,8 +131,8 @@ class XML extends Parser {
                             }
 
                             // Property type and value(s).
-                            $propertyType     = $xmlPropertyName;
-                            $xmlPropertyValue = $xmlPropertyChildren['value'];
+                            $propertyType     = $xmlPropertyChildName;
+                            $xmlPropertyValue = $xmlPropertyChild['value'];
 
                             switch($propertyType) {
 
@@ -169,11 +171,11 @@ class XML extends Parser {
                                     $periodStart         = null;
                                     $periodEndOrDuration = null;
 
-                                    foreach($xmlPropertyValue as $xmlPeriodChildren) {
+                                    foreach($xmlPropertyValue as $xmlPeriodChild) {
 
-                                        $xmlPeriodValue = $xmlPeriodChildren['value'];
+                                        $xmlPeriodValue = $xmlPeriodChild['value'];
 
-                                        switch(static::getTagName($xmlPeriodChildren['name'])) {
+                                        switch(static::getTagName($xmlPeriodChild['name'])) {
 
                                             case 'start':
                                                 $periodStart = $xmlPeriodValue;
@@ -200,10 +202,10 @@ class XML extends Parser {
                                 case 'recur':
                                     $recur = [];
 
-                                    foreach($xmlPropertyValue as $xmlRecurChildren) {
+                                    foreach($xmlPropertyValue as $xmlRecurChild) {
 
-                                        $xmlRecurName  = static::getTagName($xmlRecurChildren['name']);
-                                        $xmlRecurValue = $xmlRecurChildren['value'];
+                                        $xmlRecurName  = static::getTagName($xmlRecurChild['name']);
+                                        $xmlRecurValue = $xmlRecurChild['value'];
 
                                         if('until' === $xmlRecurName)
                                             $xmlRecurName = str_replace(
@@ -230,8 +232,6 @@ class XML extends Parser {
                                   break;
                             }
                         }
-
-                        $parentComponent->add($property);
                     }
                     break;
 

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