From b8accfb9300001a73039b08eba781292a24b8308 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 28 Dec 2015 16:56:06 +0100 Subject: [PATCH] Use integerNode for int values in configuration Closes #220. --- DependencyInjection/Configuration.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 8e362f90..29ce4b21 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -54,9 +54,9 @@ public function getConfigTreeBuilder() ->addDefaultsIfNotSet() ->children() ->booleanNode('j')->end() - ->scalarNode('timeout')->end() + ->integerNode('timeout')->end() ->scalarNode('w')->end() - ->scalarNode('wtimeout')->end() + ->integerNode('wtimeout')->end() // Deprecated options ->booleanNode('fsync')->info('Deprecated. Please use the "j" option instead.')->end() ->scalarNode('safe')->info('Deprecated. Please use the "w" option instead.')->end() @@ -135,8 +135,8 @@ private function addDocumentManagersSection(ArrayNodeDefinition $rootNode) ->end() ->end() ->end() - ->scalarNode('retry_connect')->defaultValue(0)->end() - ->scalarNode('retry_query')->defaultValue(0)->end() + ->integerNode('retry_connect')->defaultValue(0)->end() + ->integerNode('retry_query')->defaultValue(0)->end() ->arrayNode('metadata_cache_driver') ->addDefaultsIfNotSet() ->beforeNormalization() @@ -147,7 +147,7 @@ private function addDocumentManagersSection(ArrayNodeDefinition $rootNode) ->scalarNode('type')->defaultValue('array')->end() ->scalarNode('class')->end() ->scalarNode('host')->end() - ->scalarNode('port')->end() + ->integerNode('port')->end() ->scalarNode('instance_class')->end() ->scalarNode('id')->end() ->scalarNode('namespace')->end() @@ -206,7 +206,7 @@ private function addConnectionsSection(ArrayNodeDefinition $rootNode) ->values(array('SCRAM-SHA-1', 'MONGODB-CR', 'X509', 'PLAIN', 'GSSAPI')) ->end() ->booleanNode('connect')->end() - ->scalarNode('connectTimeoutMS')->end() + ->integerNode('connectTimeoutMS')->end() ->scalarNode('db')->end() ->booleanNode('journal')->end() ->scalarNode('password') @@ -237,18 +237,18 @@ private function addConnectionsSection(ArrayNodeDefinition $rootNode) ->scalarNode('replicaSet') ->validate()->ifTrue(function ($v) { return !is_string($v); })->thenInvalid('The replicaSet option must be a string')->end() ->end() - ->scalarNode('socketTimeoutMS')->end() + ->integerNode('socketTimeoutMS')->end() ->booleanNode('ssl')->end() ->scalarNode('username') ->validate()->ifNull()->thenUnset()->end() ->end() ->scalarNode('w')->end() - ->scalarNode('wTimeoutMS')->end() + ->integerNode('wTimeoutMS')->end() // Deprecated options ->booleanNode('fsync')->info('Deprecated. Please use the "journal" option instead.')->end() ->booleanNode('slaveOkay')->info('Deprecated. Please use the "readPreference" option instead.')->end() - ->scalarNode('timeout')->info('Deprecated. Please use the "connectTimeoutMS" option instead.')->end() - ->scalarNode('wTimeout')->info('Deprecated. Please use the "wTimeoutMS" option instead.')->end() + ->integerNode('timeout')->info('Deprecated. Please use the "connectTimeoutMS" option instead.')->end() + ->integerNode('wTimeout')->info('Deprecated. Please use the "wTimeoutMS" option instead.')->end() ->end() ->validate() ->ifTrue(function($v) { return count($v['readPreferenceTags']) === 0; })