From 89975ef9d6e35fa95e3d63e3b0f332eba72b8e07 Mon Sep 17 00:00:00 2001 From: "Artem Lopata (bumz)" Date: Mon, 16 Jul 2012 16:26:02 +0300 Subject: [PATCH] Added more verbose message for exception when form types have wrong getName method --- .../DependencyInjection/DependencyInjectionExtension.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php b/src/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php index efc5fdf75b..06936643a1 100644 --- a/src/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php +++ b/src/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php @@ -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;