/**
  * {@inheritdoc}
  */
 public function write(array $record)
 {
     $curlUtil = $this->curlUtil;
     $curlSession = curl_init();
     curl_setopt($curlSession, CURLOPT_URL, $this->slackConfig->getWebhook());
     curl_setopt($curlSession, CURLOPT_POST, true);
     curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($curlSession, CURLOPT_POSTFIELDS, $this->getPayload($record));
     // we return this because our mock will return the curl session
     return $curlUtil::execute($curlSession);
 }
Exemplo n.º 2
0
 /**
  * Set a custom channel if available.
  */
 private function setChannel()
 {
     if (!$this->slackConfig->getWebhook()->hasCustomChannel()) {
         return;
     }
     $this->payload['channel'] = $this->slackConfig->getWebhook()->getCustomChannel();
 }