Completed
Push — master ( 95a54c...7178fa )
by Samuel
10:58
created

DockerCompose   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 30
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getVersionCommand() 0 4 1
A getInstallCommand() 0 6 1
1
<?php
2
3
namespace Dock\Installer\System\Linux;
4
5
use Dock\Installer\SoftwareInstallTask;
6
7
class DockerCompose extends SoftwareInstallTask
8
{
9
    const VERSION = '1.3.1';
10
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function getName()
15
    {
16
        return 'dockerCompose';
17
    }
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    protected function getVersionCommand()
23
    {
24
        return 'docker-compose --version';
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function getInstallCommand()
31
    {
32
        $file = 'https://github.com/docker/compose/releases/download/'.self::VERSION.'/docker-compose-'.php_uname('s').'-'.php_uname('m');
33
34
        return "curl -L $file > /tmp/docker-compose && chmod +x /tmp/docker-compose && sudo mv /tmp/docker-compose /usr/local/bin/docker-compose";
35
    }
36
}
37