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
@@ 187-200 (lines=14) @@
184
     * @param mixed   $composeFiles  The compose files names
185
     * @param integer $timeout       If we want attempt to pull a newer version of the from image
186
     */
187
    public function restart($composeFiles = array(), $timeout = 10)
188
    {
189
        $command = 'restart';
190
191
        if ($timeout != 10) {
192
            $command .= ' --timeout='.$timeout;
193
        }
194
195
        return $this->processResult(
196
            $this->execute(
197
                $this->formatCommand($command, $this->createComposeFileCollection($composeFiles))
198
            )
199
        );
200
    }
201
202
    /**
203
     * Run service with command
@@ 256-265 (lines=10) @@
253
     *
254
     * @param mixed $composeFiles The compose files names
255
     */
256
    public function ips($composeFiles = array())
257
    {
258
        $command = $this->formatCommand('ps', $this->createComposeFileCollection($composeFiles));
259
260
        $command = 'for CONTAINER in $(' . $command . ' -q); ';
261
        $command .= 'do echo "$(docker inspect --format \' {{ .Name }} \' $CONTAINER)\t';
262
        $command .= '$(docker inspect --format \' {{ .NetworkSettings.IPAddress }} \' $CONTAINER)"; done';
263
264
        return $this->processResult($this->execute($command));
265
    }
266
267
    /**
268
     * Process result with returned code and output