Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public function field(string $text, bool $markdown = true): self
'text' => $text,
];

// Maximum number of items is 10
if (10 <= \count($this->options['fields'])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be <, with <= you throw not only for count > 10 but also for count == 10

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed in 7bac792

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guilliamxavier you're right! I have tested more over here and you're right!

throw new \LogicException('Maximum number of fields should not exceed 10.');
}

return $this;
}

Expand Down