You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -126,8 +127,8 @@ public function renderAsBadges($badgeSelector = true): self
126
127
127
128
if (\is_array($badgeSelector)) {
128
129
foreach ($badgeSelectoras$badgeType) {
129
-
if (!self::isSupportedBadge($badgeType)) {
130
-
thrownew \InvalidArgumentException(sprintf('The values of the array passed to the "%s" method must be a full 6-digit hexadecimal color or one of the following valid badge types: "%s" ("%s" given).', __METHOD__, implode(', ', self::VALID_BADGE_TYPES), $badgeType));
130
+
if (!$badgeTypeinstanceof BadgeStyle && !\in_array($badgeType, self::VALID_BADGE_TYPES, true)) {
131
+
thrownew \InvalidArgumentException(sprintf('The values of the array passed to the "%s" method must be an instance of "%s" or one of the following valid badge types: "%s" ("%s" given).', __METHOD__, BadgeStyle::class, implode(', ', self::VALID_BADGE_TYPES), $badgeType));
131
132
}
132
133
}
133
134
}
@@ -137,16 +138,6 @@ public function renderAsBadges($badgeSelector = true): self
thrownew \RuntimeException(sprintf('The value returned by the callable passed to the "renderAsBadges()" method must be a full 6-digit hexadecimal color or one of the following valid badge types: "%s" ("%s" given).', implode(', ', ChoiceField::VALID_BADGE_TYPES), $badgeType));
195
+
if (!$badgeTypeinstanceof BadgeStyle && !\in_array($badgeType, ChoiceField::VALID_BADGE_TYPES, true)) {
196
+
thrownew \RuntimeException(sprintf('The value returned by the callable passed to the "renderAsBadges()" method must be an instance of "%s" or one of the following valid badge types: "%s" ("%s" given).', BadgeStyle::class, implode(', ', ChoiceField::VALID_BADGE_TYPES), $badgeType));
195
197
}
196
198
}
197
199
198
-
if ('' !== $badgeType && !ChoiceField::isSupportedBadgeColor($badgeType)) {
0 commit comments