Total Complexity | 6 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | class KillCommand extends AbstractCommand implements \Pheanstalk\ResponseParser |
||
22 | { |
||
23 | |||
24 | /** @var WorkflowInstance $workflowInstance */ |
||
25 | private $workflowInstance; |
||
26 | |||
27 | /** @var TaskInstance $taskInstance */ |
||
28 | private $taskInstance; |
||
29 | |||
30 | /** |
||
31 | * Kills a running task instance |
||
32 | * |
||
33 | * @param WorkflowInstance $workflowInstance The WorkflowInstance |
||
34 | */ |
||
35 | 1 | public function __construct(WorkflowInstance $workflowInstance, TaskInstance $taskInstance) |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * @inheritDoc |
||
43 | */ |
||
44 | 1 | public function getGroup(): string |
|
45 | { |
||
46 | 1 | return 'instance'; |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * @inheritDoc |
||
51 | */ |
||
52 | 1 | public function getAction(): string |
|
53 | { |
||
54 | 1 | return 'killtask'; |
|
55 | } |
||
56 | |||
57 | /** |
||
58 | * @inheritDoc |
||
59 | */ |
||
60 | 1 | public function getFilters(): array |
|
61 | { |
||
62 | return [ |
||
63 | 1 | 'id' => $this->workflowInstance->getId(), |
|
64 | 1 | 'pid' => $this->taskInstance->getPid(), |
|
65 | ]; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @inheritDoc |
||
70 | */ |
||
71 | 1 | public function getResponseParser() |
|
74 | } |
||
75 | |||
76 | /** |
||
77 | * @inheritDoc |
||
78 | */ |
||
79 | 1 | public function parseResponse($responseLine, $responseData) |
|
82 | } |
||
83 | } |
||
84 |