Completed
Push — master ( 820d65...c97c2d )
by Valentin
03:28
created

AbstractCommand::_createResponse()   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 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Pheanstalk\Command;
4
5
use Pheanstalk\Command;
6
use Pheanstalk\Response;
7
use Pheanstalk\XmlResponseParser;
8
9
/**
10
 * Common functionality for Command implementations.
11
 *
12
 * @author  Paul Annesley
13
 * @package Pheanstalk
14
 * @license http://www.opensource.org/licenses/mit-license.php
15
 */
16
abstract class AbstractCommand implements Command
17
{
18
19
    /**
20
     * @inheritDoc
21
     */
22 3
    public function getFilters(): array
23
    {
24 3
        return [];
25
    }
26
27
    /**
28
     * @inheritDoc
29
     */
30 7
    public function getParameters(): array
31
    {
32 7
        return [];
33
    }
34
35
    /**
36
     * @inheritDoc
37
     */
38 3
    public function getResponseParser()
39
    {
40
        // concrete implementation must either:
41
        // a) implement ResponseParser
42
        // b) override this getResponseParser method
43 3
        return new XmlResponseParser();
44
    }
45
}
46