fixes exception (Tasks -> Tinebase)
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 8 Aug 2014 08:02:57 +0000 (10:02 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Sep 2014 09:26:40 +0000 (11:26 +0200)
+ improves coding style

Change-Id: I4a5005a184bacfd3eafc532e3dcdfca897993ec1
Reviewed-on: http://gerrit.tine20.com/customers/950
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/FileSystem.php

index 5102837..909f9a4 100644 (file)
@@ -1213,18 +1213,12 @@ class Tinebase_FileSystem implements Tinebase_Controller_Interface
     {
         if ($tempFile === NULL) {
             $tempStream = fopen('php://memory', 'r');
-        }
-        
-        else if (is_resource($tempFile)) {
+        } else if (is_resource($tempFile)) {
             $tempStream = $tempFile;
-        }
-        
-        else if (is_string($tempFile) || is_array($tempFile)) {
+        } else if (is_string($tempFile) || is_array($tempFile)) {
             $tempFile = Tinebase_TempFile::getInstance()->getTempFile($tempFile);
             return $this->copyTempfile($tempFile, $path);
-        }
-        
-        else if ($tempFile instanceof Tinebase_Model_Tree_Node) {
+        } else if ($tempFile instanceof Tinebase_Model_Tree_Node) {
             if (isset($tempFile->hash)) {
                 $hashFile = $this->_basePath . '/' . substr($tempFile->hash, 0, 3) . '/' . substr($tempFile->hash, 3);
                 $tempStream = fopen($hashFile, 'r');
@@ -1233,14 +1227,10 @@ class Tinebase_FileSystem implements Tinebase_Controller_Interface
             } else {
                 return $this->copyTempfile($tempFile->tempFile, $path);
             }
-        }
-        
-        else if ($tempFile instanceof Tinebase_Model_TempFile) {
+        } else if ($tempFile instanceof Tinebase_Model_TempFile) {
             $tempStream = fopen($tempFile->path, 'r');
-        }
-        
-        else {
-            throw new Tasks_Exception_UnexpectedValue('unexpected tempfile value');
+        } else {
+            throw new Tinebase_Exception_UnexpectedValue('unexpected tempfile value');
         }
         
         return $this->copyStream($tempStream, $path);