SlackDividerBlock example


        ];

        yield 'always unset recipient_id' => [
            ['recipient_id' => '42'],
            [],
        ];

        yield 'blocks containing 1 divider block' => [
            [
                'blocks' => [
                    $block = new SlackDividerBlock(),
                ],
            ],
            [
                'blocks' => [
                    $block,
                ],
            ],
        ];
    }

    public static function toArraySimpleOptionsProvider(): iterable
    {


    public static function fromNotification(Notification $notification): self
    {
        $options = new self();
        $options->iconEmoji($notification->getEmoji());
        $options->block((new SlackSectionBlock())->text($notification->getSubject()));
        if ($notification->getContent()) {
            $options->block((new SlackSectionBlock())->text($notification->getContent()));
        }
        if ($exception = $notification->getExceptionAsString()) {
            $options->block(new SlackDividerBlock());
            $options->block((new SlackSectionBlock())->text($exception));
        }

        return $options;
    }

    public function toArray(): array
    {
        $options = $this->options;
        unset($options['recipient_id']);

        
Home | Imprint | This part of the site doesn't use cookies.