AbstractCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 28
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getResponseParser() 0 6 1
A getFilters() 0 3 1
A getParameters() 0 3 1
1
<?php
2
3
namespace Pheanstalk\Command;
4
5
use Pheanstalk\Command;
6
use Pheanstalk\Parser\XmlResponseParser;
7
8
/**
9
 * Common functionality for Command implementations.
10
 *
11
 * @author  Valentin Corre
12
 * @package Pheanstalk
13
 * @license http://www.opensource.org/licenses/mit-license.php
14
 */
15
abstract class AbstractCommand implements Command
16
{
17
18
    /**
19
     * @inheritDoc
20
     */
21 17
    public function getFilters(): array
22
    {
23 17
        return [];
24
    }
25
26
    /**
27
     * @inheritDoc
28
     */
29 22
    public function getParameters(): array
30
    {
31 22
        return [];
32
    }
33
34
    /**
35
     * @inheritDoc
36
     */
37 5
    public function getResponseParser()
38
    {
39
        // concrete implementation must either:
40
        // a) implement ResponseParser
41
        // b) override this getResponseParser method
42 5
        return new XmlResponseParser();
43
    }
44
}
45