Code Duplication    Length = 15-17 lines in 2 locations

src/Eccube/Service/Composer/ComposerProcessService.php 2 locations

@@ 63-77 (lines=15) @@
60
     * @param string $packageName format foo/bar or foo/bar:1.0.0 or "foo/bar 1.0.0"
61
     * @return bool
62
     */
63
    public function execRequire($packageName)
64
    {
65
        set_time_limit(0);
66
        if(false === $this->init()){
67
            return false;
68
        }
69
        // Build command
70
        $command = $this->pathPHP.' '.$this->composerFile.' require '.$packageName;
71
        $command .= ' --prefer-dist --no-progress --no-suggest --no-scripts --ignore-platform-reqs --profile --no-ansi --no-interaction -d ';
72
        $command .= $this->workingDir.' 2>&1';
73
        log_info($command);
74
        $this->runCommand($command);
75
76
        return true;
77
    }
78
79
    /**
80
     * This function to remove a plugin by composer remove
@@ 86-102 (lines=17) @@
83
     * @param string $packageName format foo/bar or foo/bar:1.0.0 or "foo/bar 1.0.0"
84
     * @return bool
85
     */
86
    public function execRemove($packageName)
87
    {
88
        set_time_limit(0);
89
        if(false === $this->init()){
90
            return false;
91
        }
92
        // Build command
93
        $command = $this->pathPHP.' '.$this->composerFile.' remove '.$packageName;
94
        $command .= ' --no-progress --no-scripts --ignore-platform-reqs --profile --no-ansi --no-interaction --no-update-with-dependencies -d ';
95
        $command .= $this->workingDir.' 2>&1';
96
        log_info($command);
97
98
        // Execute command
99
        $this->runCommand($command);
100
101
        return true;
102
    }
103
104
    /**
105
     * Run command