1 | <?php |
||
18 | class SharepReleaseTaskProcessor implements TaskProcessorInterface |
||
19 | { |
||
20 | /** @var MessageFactory */ |
||
21 | private $messageFactory; |
||
22 | |||
23 | 3 | public function __construct(MessageFactory $messageFactory) |
|
24 | { |
||
25 | 3 | $this->messageFactory = $messageFactory; |
|
26 | 3 | } |
|
27 | |||
28 | 2 | public function supports(CommandData $commandData): bool |
|
29 | { |
||
30 | 2 | return (bool) preg_match("/^release\s?/i", $commandData->text); |
|
31 | } |
||
32 | |||
33 | 1 | public function process(CommandData $commandData): Layout |
|
34 | { |
||
35 | 1 | $mf = $this->messageFactory; |
|
36 | |||
37 | 1 | return $mf->layout( |
|
38 | 1 | $mf->blockSection( |
|
39 | 1 | $mf->elementPlainText('Please select dates to release'), |
|
40 | 1 | $mf->elementMultiSelectStaticGroup( |
|
41 | 1 | 'Select dates', |
|
42 | 1 | 'sharep-release-multiselect-dates', |
|
43 | 1 | [], |
|
44 | 1 | null, |
|
45 | 1 | $mf->objectOptionGroup( |
|
66 |