Skip to content

Commit

Permalink
Cast broker port configuration variable to int
Browse files Browse the repository at this point in the history
  • Loading branch information
jdecool committed Oct 14, 2018
1 parent e189055 commit c95a65e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,15 @@ public function getConfigTreeBuilder()
->children()
->scalarNode('url')->info('A URL with connection information; any parameter value parsed from this string will override explicitly set parameters')->end()
->scalarNode('host')->defaultValue('127.0.0.1')->end()
->integerNode('port')->defaultValue(5672)->end()
->integerNode('port')
->beforeNormalization()
->ifString()
->then(function(string $port): int {
return (int) $port;
})
->end()
->defaultValue(5672)
->end()
->scalarNode('login')->defaultValue('guest')->end()
->scalarNode('password')->defaultValue('guest')->end()
->scalarNode('vhost')->defaultValue('/')->end()
Expand Down

0 comments on commit c95a65e

Please sign in to comment.