/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackButtonBlockElement.php
46 строк
1 KB
Taras Hinyk
[Notifier] Add support for `confirm` option in Slack buttons API
12 окт 2025, 09:58
12 окт 2025, 09:58
c9602f0
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Notifier\Bridge\Slack\Block; /** * @author Christophe Vergne <christophe.vergne@gmail.com> */ final class SlackButtonBlockElement extends AbstractSlackBlockElement { public function __construct(string $text, ?string $url = null, ?string $style = null, ?string $value = null, ?array $confirm = null) { $this->options = [ 'type' => 'button', 'text' => [ 'type' => 'plain_text', 'text' => $text, ], ]; if ($url) { $this->options['url'] = $url; } if ($style) { // primary or danger $this->options['style'] = $style; } if ($value) { $this->options['value'] = $value; } if ($confirm) { $this->options['confirm'] = $confirm; } } }