Exemplo n.º 1
0
 public function init()
 {
     if (is_string($this->slack)) {
         $this->slack = Yii::$app->get($this->slack);
     } elseif (is_array($this->slack)) {
         if (!isset($this->slack['class'])) {
             $this->slack['class'] = Client::className();
         }
         $this->slack = Yii::createObject($this->slack);
     }
     if (!$this->slack instanceof Client) {
         throw new InvalidConfigException("LogTarget::slack must be either a Slack client instance or the application component ID of a Slack client.");
     }
 }