Passed
Branch master (7b18cd)
by Jakub
03:40
created

Tool::command()   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 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Zalas\Toolbox\Tool;
4
5
class Tool
6
{
7
    private $name;
8
    private $summary;
9
    private $website;
10
    private $command;
11
    private $testCommand;
12
    private $tags;
13
14 16
    public function __construct(string $name, string $summary, string $website, array $tags, Command $command, Command $testCommand)
15
    {
16 16
        $this->name = $name;
17 16
        $this->summary = $summary;
18 16
        $this->website = $website;
19 16
        $this->tags = \array_map(function (string $tag) {
20 6
            return $tag;
21 16
        }, $tags);
22 15
        $this->command = $command;
23 15
        $this->testCommand = $testCommand;
24
    }
25
26 5
    public function name(): string
27
    {
28 5
        return $this->name;
29
    }
30
31 3
    public function summary(): string
32
    {
33 3
        return $this->summary;
34
    }
35
36 3
    public function website(): string
37
    {
38 3
        return $this->website;
39
    }
40
41 12
    public function command(): Command
42
    {
43 12
        return $this->command;
44
    }
45
46 2
    public function testCommand(): Command
47
    {
48 2
        return $this->testCommand;
49
    }
50
51
    /**
52
     * @return array|string[]
53
     */
54 6
    public function tags(): array
55
    {
56 6
        return $this->tags;
57
    }
58
}
59