StatsTubeCommand::getGroup()   A
last analyzed

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