bug #36347 [Notifier][Slack] Error trown when having more than 10 fields specified #36346 (birkof)

This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Notifier][Slack] Error trown when having more than 10 fields specified #36346

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #36346 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

As written in [docs](https://api.slack.com/reference/block-kit/blocks#section) of Section block, for fields we have to had maximum 10 items specified.

Commits
-------

68b2490ee2 [Notifier][Slack] Error trown when having more than 10 fields specified #36346
This commit is contained in:
Fabien Potencier 2020-06-25 09:24:04 +02:00
commit 213c6ab6d5

View File

@ -44,6 +44,11 @@ final class SlackSectionBlock extends AbstractSlackBlock
'text' => $text,
];
// Maximum number of items is 10
if (10 <= \count($this->options['fields'])) {
throw new \LogicException('Maximum number of fields should not exceed 10.');
}
return $this;
}