/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackActionsBlock.php
49 строк
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 Fabien Potencier <fabien@symfony.com> */ final class SlackActionsBlock extends AbstractSlackBlock { public function __construct() { $this->options['type'] = 'actions'; } /** * @return $this */ public function button(string $text, ?string $url = null, ?string $style = null, ?string $value = null, ?array $confirm = null): static { if (25 === \count($this->options['elements'] ?? [])) { throw new \LogicException('Maximum number of buttons should not exceed 25.'); } $element = new SlackButtonBlockElement($text, $url, $style, $value, $confirm); $this->options['elements'][] = $element->toArray(); return $this; } /** * @return $this */ public function id(string $id): static { $this->options['block_id'] = $id; return $this; } }