Completed
Push — master ( 06d8dc...4a3b8a )
by Valentin
04:16
created

StatsTubeCommand   A

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
use Pheanstalk\XmlResponseParser;
7
use Pheanstalk\YamlResponseParser;
0 ignored issues
show
Bug introduced by
The type Pheanstalk\YamlResponseParser was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

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