PharDownloadCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
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 2
dl 0
loc 4
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 string $phar;
10
    private string $bin;
11
12 10
    public function __construct(string $phar, string $bin)
13
    {
14 10
        $this->phar = $phar;
15 10
        $this->bin = $bin;
16
    }
17
18 3
    public function __toString(): string
19
    {
20 3
        return \sprintf('curl -Ls -w %%{filename_effective}\'\n\' %s -o %s && chmod +x %s', $this->phar, $this->bin, $this->bin);
21
    }
22
}
23