Skip to content

Commit

Permalink
Merge pull request #331 from alcaeus/use-integer-node
Browse files Browse the repository at this point in the history
Use integerNode for int values in configuration
  • Loading branch information
malarzm committed Jan 19, 2016
2 parents 581089c + b8accfb commit 827f3a1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -136,8 +136,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()
Expand All @@ -148,7 +148,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()
Expand Down Expand Up @@ -208,7 +208,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')
Expand Down Expand Up @@ -239,18 +239,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; })
Expand Down

0 comments on commit 827f3a1

Please sign in to comment.