StatsTubeCommand   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 7
c 1
b 0
f 0
dl 0
loc 36
ccs 8
cts 8
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getGroup() 0 3 1
A getFilters() 0 4 1
A getAction() 0 3 1
1
<?php
2
3
namespace Pheanstalk\Command;
4
5
use Pheanstalk\Structure\Tube;
6
7
/**
8
 * The 'stats-tube' command.
9
 *
10
 * Gives statistical information about the specified tube if it exists.
11
 *
12
 * @author  Valentin Corre
13
 * @package Pheanstalk
14
 * @license http://www.opensource.org/licenses/mit-license.php
15
 */
16
class StatsTubeCommand extends AbstractCommand
17
{
18
    /** @var Tube $tube */
19
    private $tube;
20
21
    /**
22
     * @param Tube $tube
23
     */
24 1
    public function __construct(Tube $tube)
25
    {
26 1
        $this->tube = $tube;
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32 1
    public function getGroup(): string
33
    {
34 1
        return 'queue';
35
    }
36
37
    /**
38
     * @inheritDoc
39
     */
40 1
    public function getAction(): string
41
    {
42 1
        return 'get';
43
    }
44
45
    /**
46
     * @inheritDoc
47
     */
48 1
    public function getFilters(): array
49
    {
50
        return [
51 1
            'id' => $this->tube->getId()
52
        ];
53
    }
54
}
55