Code Duplication    Length = 10-14 lines in 3 locations

src/DockerCompose/Manager/ComposeManager.php 3 locations

@@ 85-98 (lines=14) @@
82
     * @param mixed   $composeFiles  The compose files names
83
     * @param string  $signal        Optionnal to precise SIGNAL to send to the container for SIGKILL replacement.
84
     */
85
    public function kill($composeFiles = array(), $signal = 'SIGKILL')
86
    {
87
        $command = 'kill';
88
89
        if ($signal !== 'SIGKILL') {
90
            $command .= ' -s ' . $signal;
91
        }
92
93
        return $this->processResult(
94
            $this->execute(
95
                $this->formatCommand($command, $this->createComposeFileCollection($composeFiles))
96
            )
97
        );
98
    }
99
100
    /**
101
     * Build service images
@@ 154-167 (lines=14) @@
151
     * @param mixed   $composeFiles  The compose files names
152
     * @param integer $timeout       If we want attempt to pull a newer version of the from image
153
     */
154
    public function restart($composeFiles = array(), $timeout = 10)
155
    {
156
        $command = 'restart';
157
158
        if ($timeout != 10) {
159
            $command .= ' --timeout='.$timeout;
160
        }
161
162
        return $this->processResult(
163
            $this->execute(
164
                $this->formatCommand($command, $this->createComposeFileCollection($composeFiles))
165
            )
166
        );
167
    }
168
169
    /**
170
     * Run service with command
@@ 223-232 (lines=10) @@
220
     *
221
     * @param mixed $composeFiles The compose files names
222
     */
223
    public function ips($composeFiles = array())
224
    {
225
        $command = $this->formatCommand('ps', $this->createComposeFileCollection($composeFiles));
226
227
        $command = 'for CONTAINER in $(' . $command . ' -q); ';
228
        $command .= 'do echo "$(docker inspect --format \' {{ .Name }} \' $CONTAINER)\t';
229
        $command .= '$(docker inspect --format \' {{ .NetworkSettings.IPAddress }} \' $CONTAINER)"; done';
230
231
        return $this->processResult($this->execute($command));
232
    }
233
234
    /**
235
     * Process result with returned code and output