/**
  * @param ActionDto $dto
  * @return null
  */
 public function processAction(ActionDto $dto)
 {
     $recipients = preg_split('/\\s*,\\s*/', $dto->get('recipients'));
     if (0 === count($recipients)) {
         return;
     }
     $recipientIds = [];
     foreach ($recipients as $recipient) {
         if ($recipient !== null) {
             $recipientIds[] = $this->slackFacade->getRecipientIdByName($recipient);
         }
     }
     if (0 === count($recipientIds)) {
         return;
     }
     $message = $dto->getMessage();
     $message = $this->substituteVariables($message);
     $dto->setData(array_merge($dto->getData(), ['message' => $message]));
     $this->outputManager->sendMessage($dto);
 }
예제 #2
0
 /**
  * @param ActionDto $dto
  * @param array $data
  */
 protected function populateActionDto(ActionDto $dto, $data)
 {
     $dto->setData($data);
 }
예제 #3
0
 /**
  * @param ActionDto $dto
  * @param $data
  */
 private function populateDto(ActionDto $dto, $data)
 {
     $dto->setData($data);
 }