Fix constructor. Add todo. Use array_shift instead of array_pop.
authorGunnar Wrobel <p@rdus.de>
Wed, 4 Nov 2009 15:17:51 +0000 (16:17 +0100)
committerGunnar Wrobel <p@rdus.de>
Wed, 4 Nov 2009 15:17:51 +0000 (16:17 +0100)
framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Hash.php

index 2eef350..5569e51 100644 (file)
@@ -42,7 +42,7 @@ implements Horde_Kolab_Server_Object_Interface
      * @param Horde_Kolab_Server_Object $object The represented object.
      */
     public function __construct(
-        Horde_Kolab_Server_Object $object
+        Horde_Kolab_Server_Object_Interface $object
     ) {
         $this->_object = $object;
     }
@@ -134,8 +134,9 @@ implements Horde_Kolab_Server_Object_Interface
     public function getSingle($attr)
     {
         $value = $this->getExternal($attr);
+        //@todo: Check if that can actually be something other than an array.
         if (is_array($value)) {
-            return array_pop($value);
+            return array_shift($value);
         } else {
             return $value;
         }