/**
  * @param array $notice
  * @return array|null
  */
 public function sendNotice(array $notice)
 {
     if (!$this->isEnabled()) {
         return null;
     }
     $result = $this->client->sendNotice($notice);
     if (!is_array($result)) {
         return null;
     }
     return $result;
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 protected function write(array $record)
 {
     $trace = array_slice(debug_backtrace(), 3);
     $exc = new Errors\Base($record['message'], $trace);
     $notice = $this->notifier->buildNotice($exc);
     $type = $record['channel'] . '.' . $record['level_name'];
     $notice['errors'][0]['type'] = $type;
     if (!empty($record['context'])) {
         $notice['params']['monolog_context'] = $record['context'];
     }
     if (!empty($record['extra'])) {
         $notice['params']['monolog_extra'] = $record['extra'];
     }
     return $this->notifier->sendNotice($notice);
 }