Code Duplication    Length = 12-12 lines in 3 locations

PHPDaemon/FS/FileSystem.php 3 locations

@@ 232-243 (lines=12) @@
229
     * @param  integer $pri Priority
230
     * @return resource|boolean
231
     */
232
    public static function rename($path, $newpath, $cb = null, $pri = EIO_PRI_DEFAULT)
233
    {
234
        $cb = CallbackWrapper::forceWrap($cb);
235
        if (!self::$supported) {
236
            $r = rename($path, $newpath);
237
            if ($cb) {
238
                $cb($path, $newpath, $r);
239
            }
240
            return $r;
241
        }
242
        return eio_rename($path, $newpath, $pri, $cb, $path);
243
    }
244
245
    /**
246
     * statvfs()
@@ 343-354 (lines=12) @@
340
     * @param  integer $pri Priority
341
     * @return resource|boolean
342
     */
343
    public static function touch($path, $mtime, $atime = null, $cb = null, $pri = EIO_PRI_DEFAULT)
344
    {
345
        $cb = CallbackWrapper::forceWrap($cb);
346
        if (!FileSystem::$supported) {
347
            $r = touch($path, $mtime, $atime);
348
            if ($cb) {
349
                $cb($r);
350
            }
351
            return $r;
352
        }
353
        return eio_utime($path, $atime, $mtime, $pri, $cb, $path);
354
    }
355
356
    /**
357
     * Removes empty directory
@@ 384-395 (lines=12) @@
381
     * @param  integer $pri Priority
382
     * @return resource|boolean
383
     */
384
    public static function mkdir($path, $mode, $cb = null, $pri = EIO_PRI_DEFAULT)
385
    {
386
        $cb = CallbackWrapper::forceWrap($cb);
387
        if (!FileSystem::$supported) {
388
            $r = mkdir($path, $mode);
389
            if ($cb) {
390
                $cb($path, $r);
391
            }
392
            return $r;
393
        }
394
        return eio_mkdir($path, $mode, $pri, $cb, $path);
395
    }
396
397
    /**
398
     * Readdir()