Forbid dots in connection names

This commit is contained in:
Kévin Gomez 2014-11-04 14:10:43 +00:00
parent 3d74fbdb94
commit f58fe997c5

View file

@ -35,6 +35,18 @@ class Configuration extends PropelConfiguration
->children()
->arrayNode('connections')
->isRequired()
->validate()
->always()
->then(function($connections) {
foreach ($connections as $name => $connection) {
if (strpos($name, '.') !== false) {
throw new \InvalidArgumentException('Dots are not allowed in connection names');
}
}
return $connections;
})
->end()
->requiresAtLeastOneElement()
->normalizeKeys(false)
->prototype('array')