public function getResponse($response) { $internalResponse = new BaseResponse($this->options); if ($response->isOk()) { $internalResponse->setOk('Successfully sent to: ' . $this->options->get('channel')); } else { $internalResponse->setFail('Failed to send: ' . $response->getErrorExplanation()); } return $internalResponse; }
/** * @param $response * * @return \Humweb\SlackPipe\BaseResponse */ public function getResponse($response) { $internalResponse = new BaseResponse($this->options); if ($response instanceof JIRAException) { $internalResponse->setFail('Failed to send: ' . $response->getMessage()); } elseif ($response == true && empty($response->errorMessages)) { $internalResponse->setOk('Successfully sent to: ' . $this->issue); } else { $internalResponse->setFail('Failed to send: ' . implode(PHP_EOL, $response->errorMessages)); } return $internalResponse; }