Code Duplication    Length = 7-9 lines in 3 locations

src/MagentoHackathon/Composer/Magento/Deploystrategy/Copy.php 1 location

@@ 74-80 (lines=7) @@
71
        // From now on $destPath can't be a directory, that case is already handled
72
73
        // If file exists and force is not specified, throw exception unless FORCE is set
74
        if (file_exists($destPath)) {
75
            if ($this->isForced()) {
76
                unlink($destPath);
77
            } else {
78
                throw new \ErrorException("Target $dest already exists (set extra.magento-force to override)");
79
            }
80
        }
81
82
        // File to file
83
        if (!is_dir($sourcePath)) {

src/MagentoHackathon/Composer/Magento/Deploystrategy/Link.php 1 location

@@ 56-62 (lines=7) @@
53
        // From now on $destPath can't be a directory, that case is already handled
54
55
        // If file exists and force is not specified, throw exception unless FORCE is set
56
        if (file_exists($destPath)) {
57
            if ($this->isForced()) {
58
                unlink($destPath);
59
            } else {
60
                throw new \ErrorException("Target $dest already exists (set extra.magento-force to override)");
61
            }
62
        }
63
64
        // File to file
65
        if (!is_dir($sourcePath)) {

src/MagentoHackathon/Composer/Magento/Deploystrategy/Symlink.php 1 location

@@ 89-97 (lines=9) @@
86
87
        // If file exists and force is not specified, throw exception unless FORCE is set
88
        // existing symlinks are already handled
89
        if (file_exists($destPath)) {
90
            if ($this->isForced()) {
91
                unlink($destPath);
92
            } else {
93
                throw new \ErrorException(
94
                    "Target $dest already exists and is not a symlink (set extra.magento-force to override)"
95
                );
96
            }
97
        }
98
99
        $relSourcePath = $this->getRelativePath($destPath, $sourcePath);
100