GenericCommand   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 2
cbo 2
dl 0
loc 50
ccs 12
cts 12
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCommandLine() 0 4 1
A hasData() 0 4 1
A getData() 0 4 1
A parseResponse() 0 4 1
1
<?php
2
3
4
namespace Beanie\Command;
5
6
7
use Beanie\Command\CommandLineCreator\CommandLineCreatorInterface;
8
use Beanie\Command\ResponseParser\ResponseParserInterface;
9
use Beanie\Server\Server;
10
11
class GenericCommand implements CommandInterface
12
{
13
    /** @var CommandLineCreatorInterface */
14
    protected $commandLineCreator;
15
16
    /** @var ResponseParserInterface */
17
    protected $responseParser;
18
19
    /**
20
     * @param CommandLineCreatorInterface $commandLineCreator
21
     * @param ResponseParserInterface $responseParser
22
     */
23 50
    public function __construct(CommandLineCreatorInterface $commandLineCreator, ResponseParserInterface $responseParser)
24
    {
25 50
        $this->commandLineCreator = $commandLineCreator;
26 50
        $this->responseParser = $responseParser;
27 50
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32 35
    public function getCommandLine()
33
    {
34 35
        return $this->commandLineCreator->getCommandLine();
35
    }
36
37
    /**
38
     * @inheritDoc
39
     */
40 6
    public function hasData()
41
    {
42 6
        return $this->commandLineCreator->hasData();
43
    }
44
45
    /**
46
     * @inheritDoc
47
     */
48 6
    public function getData()
49
    {
50 6
        return $this->commandLineCreator->getData();
51
    }
52
53
    /**
54
     * @inheritDoc
55
     */
56 1
    public function parseResponse($responseLine, Server $server)
57
    {
58 1
        return $this->responseParser->parseResponse($responseLine, $server);
59
    }
60
}
61