Passed
Push — master ( df446a...4986ba )
by Jakub
02:29 queued 10s
created

ComposerBinPluginCommand::package()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
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 ComposerBinPluginCommand implements Command
8
{
9
    private $package;
10
    private $namespace;
11
12 10
    public function __construct(string $package, string $namespace)
13
    {
14 10
        $this->package = $package;
15 10
        $this->namespace = $namespace;
16
    }
17
18 1
    public function __toString(): string
19
    {
20 1
        return \sprintf('composer global bin %s require --no-suggest --prefer-dist --update-no-dev -n %s', $this->namespace, $this->package);
21
    }
22
23 3
    public function package(): string
24
    {
25 3
        return $this->package;
26
    }
27
28 3
    public function namespace(): string
29
    {
30 3
        return $this->namespace;
31
    }
32
}
33