Total Complexity | 6 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class CreateCommand extends AbstractCommand implements ResponseParser |
||
19 | { |
||
20 | /** @var Workflow $workflow */ |
||
21 | private $workflow; |
||
22 | |||
23 | /** |
||
24 | * Puts a job on the queue. |
||
25 | * |
||
26 | * @param Workflow $workflow The workflow to create |
||
27 | */ |
||
28 | 6 | public function __construct(Workflow $workflow) |
|
29 | { |
||
30 | 6 | $this->workflow = $workflow; |
|
31 | } |
||
32 | |||
33 | /** |
||
34 | * @inheritDoc |
||
35 | */ |
||
36 | 6 | public function getGroup(): string |
|
37 | { |
||
38 | 6 | return 'workflow'; |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * @inheritDoc |
||
43 | */ |
||
44 | 6 | public function getAction(): string |
|
45 | { |
||
46 | 6 | return 'create'; |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * @inheritDoc |
||
51 | */ |
||
52 | 6 | public function getFilters(): array |
|
53 | { |
||
54 | return [ |
||
55 | 6 | 'name' => $this->workflow->getName(), |
|
56 | 6 | "group" => $this->workflow->getGroup(), |
|
57 | 6 | 'content' => base64_encode($this->workflow->getXml()->saveXML()), |
|
58 | 6 | 'comment' => $this->workflow->getComment() |
|
59 | ]; |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @inheritDoc |
||
64 | */ |
||
65 | 6 | public function getResponseParser() |
|
66 | { |
||
67 | 6 | return $this; |
|
68 | } |
||
69 | |||
70 | /** |
||
71 | * @inheritDoc |
||
72 | */ |
||
73 | 6 | public function parseResponse($responseLine, $responseData) |
|
77 | } |
||
78 | } |
||
79 |