| @@ 29-39 (lines=11) @@ | ||
| 26 | * |
|
| 27 | * @throws \Kerox\Messenger\Exception\MessengerException |
|
| 28 | */ |
|
| 29 | public function __construct(string $title, array $buttons) |
|
| 30 | { |
|
| 31 | parent::__construct(self::TYPE_NESTED); |
|
| 32 | ||
| 33 | $this->isValidString($title, 20); |
|
| 34 | $this->isValidArray($buttons, 5); |
|
| 35 | $this->isValidButtons($buttons, $this->getAllowedButtonsType()); |
|
| 36 | ||
| 37 | $this->title = $title; |
|
| 38 | $this->buttons = $buttons; |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @throws \Kerox\Messenger\Exception\MessengerException |
|
| @@ 31-41 (lines=11) @@ | ||
| 28 | * |
|
| 29 | * @param \Kerox\Messenger\Model\Common\Button\AbstractButton[] $buttons |
|
| 30 | */ |
|
| 31 | public function __construct(string $text, array $buttons, bool $sharable = false) |
|
| 32 | { |
|
| 33 | parent::__construct(); |
|
| 34 | ||
| 35 | $this->isValidString($text, 640); |
|
| 36 | $this->isValidArray($buttons, 3); |
|
| 37 | ||
| 38 | $this->text = $text; |
|
| 39 | $this->buttons = $buttons; |
|
| 40 | $this->sharable = $sharable; |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * @return \Kerox\Messenger\Model\Message\Attachment\Template\ButtonTemplate |
|