Test Failed
Pull Request — master (#369)
by Mihai
03:40
created

PhiveInstallCommand::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Zalas\Toolbox\Tool\Command;
4
5
use Zalas\Toolbox\Tool\Command;
6
7
final class PhiveInstallCommand implements Command
8
{
9
    private $alias;
10
    private $bin;
11
12
    public function __construct(string $alias, string $bin)
13
    {
14
        $this->alias = $alias;
15
        $this->bin = $bin;
16
    }
17
18
    public function __toString(): string
19
    {
20
        $home = dirname($this->bin);
21
        return \sprintf(
22
            'phive --home %s install --force-accept-unsigned %s -t %s',
23
            $home,
24
            $this->alias,
25
            $this->bin
26
        );
27
    }
28
}
29