Code Duplication    Length = 11-11 lines in 2 locations

src/Task/Filesystem/CleanDir.php 1 location

@@ 26-36 (lines=11) @@
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function run()
27
    {
28
        if (!$this->checkResources($this->dirs, 'dir')) {
29
            return Result::error($this, 'Source directories are missing!');
30
        }
31
        foreach ($this->dirs as $dir) {
32
            $this->emptyDir($dir);
33
            $this->printTaskInfo("Cleaned {dir}", ['dir' => $dir]);
34
        }
35
        return Result::success($this);
36
    }
37
38
    /**
39
     * @param string $path

src/Task/Filesystem/DeleteDir.php 1 location

@@ 26-36 (lines=11) @@
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function run()
27
    {
28
        if (!$this->checkResources($this->dirs, 'dir')) {
29
            return Result::error($this, 'Source directories are missing!');
30
        }
31
        foreach ($this->dirs as $dir) {
32
            $this->fs->remove($dir);
33
            $this->printTaskInfo("Deleted {dir}...", ['dir' => $dir]);
34
        }
35
        return Result::success($this);
36
    }
37
}
38