Code Duplication    Length = 18-18 lines in 2 locations

src/Eccube/Service/ComposerProcessService.php 2 locations

@@ 52-69 (lines=18) @@
49
     * @param string $packageName
50
     * @return bool
51
     */
52
    public function execRequire($packageName)
53
    {
54
        set_time_limit(0);
55
        $this->setupComposer();
56
        // Build command
57
        $packageName = self::$vendorName.'/'.$packageName;
58
        $command = $this->getPHP().' '.$this->composerFile.' require '.$packageName;
59
        $command .= ' --prefer-dist --no-progress --no-suggest --no-scripts --ignore-platform-reqs --profile --no-ansi --no-interaction -d ';
60
        $command .= $this->appConfig['root_dir'].' 2>&1';
61
        log_info($command);
62
63
        // Execute command
64
        $output = array();
65
        exec($command, $output);
66
        log_info(PHP_EOL.implode(PHP_EOL, $output).PHP_EOL);
67
68
        return true;
69
    }
70
71
    /**
72
     * This function to remove a plugin by composer remove
@@ 78-95 (lines=18) @@
75
     * @param string $packageName
76
     * @return bool
77
     */
78
    public function execRemove($packageName)
79
    {
80
        set_time_limit(0);
81
        $this->setupComposer();
82
        // Build command
83
        $packageName = self::$vendorName.'/'.$packageName;
84
        $command = $this->getPHP().' '.$this->composerFile.' remove '.$packageName;
85
        $command .= ' --no-progress --no-scripts --ignore-platform-reqs --profile --no-ansi --no-interaction -d ';
86
        $command .= $this->appConfig['root_dir'].' 2>&1';
87
        log_info($command);
88
89
        // Execute command
90
        $output = array();
91
        exec($command, $output);
92
        log_info(PHP_EOL.implode(PHP_EOL, $output).PHP_EOL);
93
94
        return true;
95
    }
96
97
    /**
98
     * Get environment php command