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

ComposerBinPluginCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 24
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

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