Skip to content

Commit 8153e2e

Browse files
committed
Merge pull request #58
2 parents 1533d97 + 9f9a2c2 commit 8153e2e

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

DependencyInjection/BazingaGeocoderExtension.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ public function load(array $configs, ContainerBuilder $container)
114114
}
115115

116116
if (isset($config['providers']['mapquest'])) {
117-
$this->addProvider('mapquest');
117+
$mapquestParams = $config['providers']['mapquest'];
118+
119+
$this->addProvider('mapquest', array($mapquestParams['api_key']));
118120
}
119121

120122
if (isset($config['providers']['oiorest'])) {

DependencyInjection/Configuration.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@ public function getConfigTreeBuilder()
121121
->arrayNode('host_ip')->end()
122122
->arrayNode('geoip')->end()
123123
->arrayNode('free_geo_ip')->end()
124-
->arrayNode('mapquest')->end()
124+
->arrayNode('mapquest')
125+
->children()
126+
->scalarNode('api_key')
127+
->isRequired()->cannotBeEmpty()
128+
->end()
129+
->end()
130+
->end()
125131
->arrayNode('oiorest')->end()
126132
->arrayNode('geocoder_ca')->end()
127133
->arrayNode('geocoder_us')->end()

Resources/doc/index.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ bazinga_geocoder:
244244
host_ip: []
245245
geoip: []
246246
free_geo_ip: []
247-
mapquest: []
247+
mapquest:
248+
api_key: ~ # Required
248249
oiorest: []
249250
geocoder_ca: []
250251
geocoder_us: []

Tests/DependencyInjection/Fixtures/config.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ bazinga_geocoder:
3030
host_ip: ~
3131
# geoip: ~
3232
free_geo_ip: ~
33-
mapquest: ~
33+
mapquest:
34+
api_key: 123
3435
oiorest: ~
3536
geocoder_ca: ~
3637
geocoder_us: ~

0 commit comments

Comments
 (0)