Added more verbose message for exception when form types have wrong getName method
This commit is contained in:
parent
4ce724936a
commit
89975ef9d6
|
@ -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;
|
||||
|
|
Reference in New Issue