[Form] Add exception to FormRenderer about non-unique block names

This commit is contained in:
Jáchym Toušek 2016-06-19 11:04:47 +02:00
parent 0854c121c9
commit c6db6f3d50

View File

@ -253,10 +253,11 @@ class FormRenderer implements FormRendererInterface
// Escape if no resource exists for this block // Escape if no resource exists for this block
if (!$resource) { if (!$resource) {
throw new LogicException(sprintf( if (count($blockNameHierarchy) !== count(array_unique($blockNameHierarchy))) {
'Unable to render the form as none of the following blocks exist: "%s".', throw new LogicException(sprintf('Unable to render the form because the block names array contains duplicates: "%s".', implode('", "', array_reverse($blockNameHierarchy))));
implode('", "', array_reverse($blockNameHierarchy)) }
));
throw new LogicException(sprintf('Unable to render the form as none of the following blocks exist: "%s".', implode('", "', array_reverse($blockNameHierarchy))));
} }
// Merge the passed with the existing attributes // Merge the passed with the existing attributes