This commit is contained in:
Adrien SAMSON 2013-03-19 15:42:32 +01:00
parent c8a0115040
commit dee44ee2e1

View File

@ -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')]);
}
}
}