PharDownloadCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 3 1
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