Added more verbose message for exception when form types have wrong getName method

This commit is contained in:
Artem Lopata (bumz) 2012-07-16 16:26:02 +03:00 committed by Artem Lopata
parent 4ce724936a
commit 89975ef9d6
1 changed files with 6 additions and 1 deletions

View File

@ -46,7 +46,12 @@ class DependencyInjectionExtension implements FormExtensionInterface
$type = $this->container->get($this->typeServiceIds[$name]);
if ($type->getName() !== $name) {
throw new \InvalidArgumentException(sprintf('The type name specified for the service %s does not match the actual name', $this->typeServiceIds[$name]));
throw new \InvalidArgumentException(
sprintf('The type name specified for the service "%s" does not match the actual name. Expected "%s", given "%s"',
$this->typeServiceIds[$name],
$name,
$type->getName()
));
}
return $type;