From dee44ee2e1a8a34a1a38eb703460cf4ba80c8d26 Mon Sep 17 00:00:00 2001 From: Adrien SAMSON Date: Tue, 19 Mar 2013 15:42:32 +0100 Subject: [PATCH] Fix #147 --- Parser/FormTypeParser.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Parser/FormTypeParser.php b/Parser/FormTypeParser.php index 75bb680..ecace3f 100644 --- a/Parser/FormTypeParser.php +++ b/Parser/FormTypeParser.php @@ -90,8 +90,10 @@ class FormTypeParser implements ParserInterface for ($type = $config->getType(); null !== $type; $type = $type->getParent()) { if (isset($this->mapTypes[$type->getName()])) { $bestType = $this->mapTypes[$type->getName()]; - } elseif ('collection' === $type->getName() && isset($this->mapTypes[$config->getOption('type')])) { - $bestType = sprintf('array of %ss', $this->mapTypes[$config->getOption('type')]); + } elseif ('collection' === $type->getName()) { + if (is_string($config->getOption('type')) && isset($this->mapTypes[$config->getOption('type')])) { + $bestType = sprintf('array of %ss', $this->mapTypes[$config->getOption('type')]); + } } }