Author: Sebastian Bergmann
Date: 2007-05-03 13:10:42 +0200 (Thu, 03 May 2007)
New Revision: 4981

Log:
- Tweak code for 100% coverage.
Modified:
   trunk/Workflow/src/definitions/xml.php

Modified: trunk/Workflow/src/definitions/xml.php
===================================================================
--- trunk/Workflow/src/definitions/xml.php      2007-05-03 11:10:04 UTC (rev 
4980)
+++ trunk/Workflow/src/definitions/xml.php      2007-05-03 11:10:42 UTC (rev 
4981)
@@ -573,20 +573,19 @@
      */
     protected function xmlToVariable( SimpleXMLElement $node )
     {
-        $type = $node->getName();
+        $type     = $node->getName();
+        $variable = null;
 
         switch ( $type )
         {
             case 'array': {
-                $array = array();
+                $variable = array();
 
                 foreach ( $node->element as $element )
                 {
                     $children = $element->children();
-                    $array[(string)$element['key']] = $this->xmlToVariable( 
$children[0] );
+                    $variable[(string)$element['key']] = $this->xmlToVariable( 
$children[0] );
                 }
-
-                return $array;
             }
             break;
 
@@ -605,12 +604,12 @@
 
                     $class = new ReflectionClass( $className );
 
-                    return $class->newInstanceArgs( $constructorArgs );
+                    $variable = $class->newInstanceArgs( $constructorArgs );
                     
                 }
                 else
                 {
-                    return new $className;
+                    $variable = new $className;
                 }
             }
             break;
@@ -622,16 +621,11 @@
                 $variable = (string)$node;
 
                 settype( $variable, $type );
-
-                return $variable;
             }
             break;
-
-            case 'null': {
-                return null;
-            }
-            break;
         }
+
+        return $variable;
     }
 
     /**

-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to