Skip to content

Commit 9f9a2c2

Browse files
YvanLwilldurand
authored andcommitted
ApiKey Required for MapQuest provider
Changes related to : geocoder-php/Geocoder#276
1 parent df228ff commit 9f9a2c2

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

DependencyInjection/BazingaGeocoderExtension.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ public function load(array $configs, ContainerBuilder $container)
123123
}
124124

125125
if (isset($config['providers']['mapquest'])) {
126-
$this->addProvider('mapquest');
126+
$mapquestParams = $config['providers']['mapquest'];
127+
128+
$this->addProvider('mapquest', array($mapquestParams['api_key']));
127129
}
128130

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

DependencyInjection/Configuration.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ public function getConfigTreeBuilder()
129129
->arrayNode('host_ip')->end()
130130
->arrayNode('geoip')->end()
131131
->arrayNode('free_geo_ip')->end()
132-
->arrayNode('mapquest')->end()
132+
->arrayNode('mapquest')
133+
->children()
134+
->scalarNode('api_key')
135+
->isRequired()->cannotBeEmpty()
136+
->end()
137+
->end()
138+
->end()
133139
->arrayNode('oiorest')->end()
134140
->arrayNode('geocoder_ca')->end()
135141
->arrayNode('geocoder_us')->end()

Resources/doc/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ bazinga_geocoder:
245245
host_ip: []
246246
geoip: []
247247
free_geo_ip: []
248-
mapquest: []
248+
mapquest:
249+
api_key: ~ # Required
249250
oiorest: []
250251
geocoder_ca: []
251252
geocoder_us: []

Tests/DependencyInjection/Fixtures/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ bazinga_geocoder:
3333
host_ip: ~
3434
# geoip: ~
3535
free_geo_ip: ~
36-
mapquest: ~
36+
mapquest:
37+
api_key: 123
3738
oiorest: ~
3839
geocoder_ca: ~
3940
geocoder_us: ~

0 commit comments

Comments
 (0)