getGroupValues($context, $groupName); while (in_array(end($occurrences), ['', null], true)) { array_pop($occurrences); } $missingChoices = []; foreach ($occurrences as $k => $v) { if (empty($v)) { $missingChoices[] = $k; } } if (!empty($missingChoices)) { $exception = new ErrorValidationException( 'Error: %s is empty, although it is mandatory.', [ implode(', ', $missingChoices), ] ); $exception->setColumn($column); throw $exception; } } }