Passed
Pull Request — master (#26)
by Valentin
05:17
created

DeleteCommand::parseResponse()   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\Parser\RequestOkResponseParser;
6
use Pheanstalk\Structure\Workflow;
7
8
/**
9
 * The 'delete' command.
10
 *
11
 * Permanently deletes an already-reserved job.
12
 *
13
 * @author  Paul Annesley
14
 * @package Pheanstalk
15
 * @license http://www.opensource.org/licenses/mit-license.php
16
 */
17
class DeleteCommand extends AbstractCommand
18
{
19
    /** @var Workflow $workflow */
20
    private $workflow;
21
22
    /**
23
     * @param Workflow $workflow
24
     */
25 5
    public function __construct(Workflow $workflow)
26
    {
27 5
        $this->workflow = $workflow;
28
    }
29
30
    /**
31
     * @inheritDoc
32
     */
33 5
    public function getGroup(): string
34
    {
35 5
        return 'workflow';
36
    }
37
38
    /**
39
     * @inheritDoc
40
     */
41 5
    public function getAction(): string
42
    {
43 5
        return 'delete';
44
    }
45
46
    /**
47
     * @inheritDoc
48
     */
49 5
    public function getFilters(): array
50
    {
51
        return [
52 5
            'id' => $this->workflow->getId()
53
        ];
54
    }
55
56
    /**
57
     * @inheritDoc
58
     */
59 5
    public function getResponseParser()
60
    {
61 5
        return new RequestOkResponseParser();
62
    }
63
}
64