From f58fe997c584d7722da6f83310463e6dd7d27d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Gomez?= Date: Tue, 4 Nov 2014 14:10:43 +0000 Subject: [PATCH] Forbid dots in connection names --- DependencyInjection/Configuration.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index da5b93b..5a3a5ef 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -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')