private function validateLabels($input, array $acceptedLabels, $supportDynamic)
{
$inputLabels = array_map('trim', explode(',', $input));
$labels = [];
foreach ($inputLabels as $label) {
if ('' === $label) {
continue;
}
if (!$supportDynamic && !in_array($label, $acceptedLabels, true)) {
throw new \InvalidArgumentException(sprintf('Label "%s" is not accepted, use a comma to separate labels like "L-1, L-3".', $label));
}
$labels[] = $label;
}
return $labels;
}