GenericCommand::hasData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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