/** * {@inheritdoc} */ public function __construct($data = []) { if (!isset($data['fields'])) { $data['fields'] = new FieldCollection(); } parent::__construct($data); }
/** * @param $text * @param null $channel * @param null $username * @param null $iconEmoji */ public function __construct($text, $channel = null, $username = null, $iconEmoji = null) { parent::__construct(['text' => $text, 'channel' => $channel, 'username' => $username, 'icon_emoji' => $iconEmoji, 'attachments' => new AttachmentCollection()]); }