Bläddra i källkod

[Uploadable] Removed unused code

comfortablynumb 13 år sedan
förälder
incheckning
83686ac448

+ 1 - 13
lib/Gedmo/Uploadable/UploadableListener.php

@@ -256,7 +256,7 @@ class UploadableListener extends MappedEventSubscriber
         $info['fileName'] = $fileInfo['name'];
         $info['filePath'] = $path.'/'.$info['fileName'];
 
-        if ($this->isUploadedFile($fileInfo['tmp_name']) && $this->moveUploadedFile($fileInfo['tmp_name'], $info['filePath'])) {
+        if ($this->moveUploadedFile($fileInfo['tmp_name'], $info['filePath'])) {
             return $info;
         } else {
             throw new UploadableUploadException(sprintf('File "%s" was not uploaded, or there was a problem moving it to the location "%s".',
@@ -266,18 +266,6 @@ class UploadableListener extends MappedEventSubscriber
         }
     }
 
-    /**
-     * Simple wrapper to "is_uploaded_file" function so we can mock it in tests
-     *
-     * @param string
-     *
-     * @return bool
-     */
-    public function isUploadedFile($file)
-    {
-        return is_uploaded_file($file);
-    }
-
     /**
      * Simple wrapper to "move_uploaded_file" function so we can mock it in tests
      *

+ 0 - 5
tests/Gedmo/Uploadable/Stub/UploadableListenerStub.php

@@ -16,11 +16,6 @@ use Gedmo\Uploadable\UploadableListener;
 
 class UploadableListenerStub extends UploadableListener
 {
-    public function isUploadedFile()
-    {
-        return true;
-    }
-
     public function moveUploadedFile($source, $dest)
     {
         return copy($source, $dest);