Code Duplication    Length = 10-14 lines in 3 locations

src/DockerCompose/Manager/ComposeManager.php 3 locations

@@ 78-91 (lines=14) @@
75
     * @param mixed   $composeFiles  The compose files names
76
     * @param string  $signal        Optionnal to precise SIGNAL to send to the container for SIGKILL replacement.
77
     */
78
    public function kill($composeFiles = array(), $signal = 'SIGKILL')
79
    {
80
        $command = 'kill';
81
82
        if ($signal !== 'SIGKILL') {
83
            $command .= ' -s ' . $signal;
84
        }
85
86
        return $this->processResult(
87
            $this->execute(
88
                $this->formatCommand($command, $this->createComposeFileCollection($composeFiles))
89
            )
90
        );
91
    }
92
93
    /**
94
     * Build service images
@@ 131-144 (lines=14) @@
128
     * @param mixed   $composeFiles  The compose files names
129
     * @param integer $timeout       If we want attempt to pull a newer version of the from image
130
     */
131
    public function restart($composeFiles = array(), $timeout = 10)
132
    {
133
        $command = 'restart';
134
135
        if ($timeout != 10) {
136
            $command .= ' --timeout='.$timeout;
137
        }
138
139
        return $this->processResult(
140
            $this->execute(
141
                $this->formatCommand($command, $this->createComposeFileCollection($composeFiles))
142
            )
143
        );
144
    }
145
146
    /**
147
     * Run service with command
@@ 186-195 (lines=10) @@
183
     *
184
     * @param mixed $composeFiles The compose files names
185
     */
186
    public function ips($composeFiles = array())
187
    {
188
        $command = $this->formatCommand('ps', $this->createComposeFileCollection($composeFiles));
189
190
        $command = 'for CONTAINER in $(' . $command . ' -q); ';
191
        $command .= 'do echo "$(docker inspect --format \' {{ .Name }} \' $CONTAINER)\t';
192
        $command .= '$(docker inspect --format \' {{ .NetworkSettings.IPAddress }} \' $CONTAINER)"; done';
193
194
        return $this->processResult($this->execute($command));
195
    }
196
197
    /**
198
     * Process result with returned code and output