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

ComposeExecutableFinder::find()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 2
eloc 6
nc 2
nop 0
1
<?php
2
3
namespace Dock\Docker\Compose;
4
5
use Symfony\Component\Process\ExecutableFinder;
6
7
class ComposeExecutableFinder
8
{
9
    /**
10
     * @var ExecutableFinder
11
     */
12
    private $executableFinder;
13
14
    public function __construct()
15
    {
16
        $this->executableFinder = new ExecutableFinder();
17
    }
18
19
    /**
20
     * @return string
21
     */
22
    public function find()
23
    {
24
        if (null === ($executable = $this->executableFinder->find('docker-compose'))) {
25
            throw new \RuntimeException(
26
                'Unable to find docker-compose binary. '.
27
                'You should run `docker:install` to set up your Docker environment'
28
            );
29
        }
30
31
        return $executable;
32
    }
33
}
34