Code Duplication    Length = 12-12 lines in 2 locations

src/datasource/File.php 2 locations

@@ 123-134 (lines=12) @@
120
     * @param string $pathToFrom
121
     * @return bool
122
     */
123
    public function move($filename, $pathTo, $pathFrom = null)
124
    {
125
        if ($pathFrom==null) {
126
            $pathFrom=$this->_filePath;
127
        }
128
        if (file_exists($pathFrom."/".$filename)) {
129
            $this->createDir($pathTo);
130
            return rename($pathFrom."/".$filename, $pathTo."/".$filename);
131
        } else {
132
            return null;
133
        }
134
    }
135
    
136
    /**
137
     * Rename a file
@@ 145-156 (lines=12) @@
142
     * @return bool
143
     * @todo consider merging rename() and move() into one method
144
     */
145
    public function rename($oldName, $newName, $pathToFile = null)
146
    {
147
        if ($pathToFile==null) {
148
            $pathToFile=$this->_filePath;
149
        }
150
        if (file_exists($pathToFile."/".$oldName)) {
151
            $this->createDir($pathToFile);
152
            return rename($pathToFile."/".$oldName, $pathToFile."/".$newName);
153
        } else {
154
            return false;
155
        }
156
    }
157
    
158
    /**
159
     * Copy a file