Completed
Pull Request — master (#4)
by Jakub
03:36
created

PharDownloadCommand::import()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Zalas\Toolbox\Tool\Command;
4
5
use Zalas\Toolbox\Tool\Command;
6
7
final class PharDownloadCommand implements Command
8
{
9
    private $phar;
10
    private $bin;
11
12 8
    public function __construct(string $phar, string $bin)
13
    {
14 8
        $this->phar = $phar;
15 8
        $this->bin = $bin;
16
    }
17
18 2
    public function __toString(): string
19
    {
20 2
        return \sprintf('curl -Ls -w %%{filename_effective}\'\n\' %s -o %s && chmod +x %s', $this->phar, $this->bin, $this->bin);
21
    }
22
}
23