77 *
88 * @license MIT License
99 */
10-
1110namespace Bazinga \Bundle \GeocoderBundle \DependencyInjection ;
1211
1312use Symfony \Component \HttpKernel \DependencyInjection \Extension ;
1918use Symfony \Component \Config \Definition \Processor ;
2019
2120/**
22- * William Durand <william.durand1@gmail.com>
21+ * William Durand <william.durand1@gmail.com>.
2322 */
2423class BazingaGeocoderExtension extends Extension
2524{
@@ -29,9 +28,9 @@ public function load(array $configs, ContainerBuilder $container)
2928 {
3029 $ this ->container = $ container ;
3130
32- $ processor = new Processor ();
33- $ configuration = new Configuration ();
34- $ config = $ processor ->processConfiguration ($ configuration , $ configs );
31+ $ processor = new Processor ();
32+ $ configuration = new Configuration ();
33+ $ config = $ processor ->processConfiguration ($ configuration , $ configs );
3534
3635 $ loader = new XmlFileLoader ($ container , new FileLocator (__DIR__ .'/../Resources/config ' ));
3736 $ loader ->load ('services.xml ' );
@@ -77,7 +76,7 @@ public function load(array $configs, ContainerBuilder $container)
7776 $ ipInfoDbParams = $ config ['providers ' ]['ip_info_db ' ];
7877
7978 $ this ->addProvider ('ip_info_db ' , array (
80- $ ipInfoDbParams ['api_key ' ]
79+ $ ipInfoDbParams ['api_key ' ],
8180 ));
8281 }
8382
@@ -108,7 +107,7 @@ public function load(array $configs, ContainerBuilder $container)
108107 $ openstreetMapsParams = $ config ['providers ' ]['openstreetmap ' ];
109108
110109 $ this ->addProvider ('openstreetmap ' , array (
111- $ openstreetMapsParams ['locale ' ]
110+ $ openstreetMapsParams ['locale ' ],
112111 ));
113112 }
114113
@@ -120,7 +119,7 @@ public function load(array $configs, ContainerBuilder $container)
120119 $ mapQuestParams = $ config ['providers ' ]['mapquest ' ];
121120
122121 $ this ->addProvider ('mapquest ' , array (
123- $ mapQuestParams ['api_key ' ]
122+ $ mapQuestParams ['api_key ' ],
124123 ));
125124 }
126125
@@ -140,7 +139,7 @@ public function load(array $configs, ContainerBuilder $container)
140139 $ ignOpenlsParams = $ config ['providers ' ]['ign_openls ' ];
141140
142141 $ this ->addProvider ('ign_openls ' , array (
143- $ ignOpenlsParams ['api_key ' ]
142+ $ ignOpenlsParams ['api_key ' ],
144143 ));
145144 }
146145
@@ -153,15 +152,15 @@ public function load(array $configs, ContainerBuilder $container)
153152
154153 $ this ->addProvider ('yandex ' , array (
155154 $ yandexParams ['locale ' ],
156- $ yandexParams ['toponym ' ]
155+ $ yandexParams ['toponym ' ],
157156 ));
158157 }
159158
160159 if (isset ($ config ['providers ' ]['geo_ips ' ])) {
161160 $ geoIpsParams = $ config ['providers ' ]['geo_ips ' ];
162161
163162 $ this ->addProvider ('geo_ips ' , array (
164- $ geoIpsParams ['api_key ' ]
163+ $ geoIpsParams ['api_key ' ],
165164 ));
166165 }
167166
@@ -173,7 +172,7 @@ public function load(array $configs, ContainerBuilder $container)
173172 $ maxmindParams = $ config ['providers ' ]['maxmind ' ];
174173
175174 $ this ->addProvider ('maxmind ' , array (
176- $ maxmindParams ['api_key ' ]
175+ $ maxmindParams ['api_key ' ],
177176 ));
178177 }
179178
@@ -206,8 +205,8 @@ public function load(array $configs, ContainerBuilder $container)
206205 }
207206
208207 if (isset ($ config ['providers ' ]['cache ' ])) {
209- $ params = $ config ['providers ' ]['cache ' ];
210- $ cache = new Reference ($ params ['adapter ' ]);
208+ $ params = $ config ['providers ' ]['cache ' ];
209+ $ cache = new Reference ($ params ['adapter ' ]);
211210 $ fallback = new Reference ('bazinga_geocoder.provider. ' .$ params ['provider ' ]);
212211
213212 $ provider = new Definition (
@@ -241,7 +240,7 @@ public function load(array $configs, ContainerBuilder $container)
241240 foreach ($ config ['providers ' ]['chain ' ]['providers ' ] as $ name ) {
242241 if ($ this ->container ->hasDefinition ('bazinga_geocoder.provider. ' .$ name )) {
243242 $ chainProvider ->addMethodCall ('addProvider ' , array (
244- $ this ->container ->getDefinition ('bazinga_geocoder.provider. ' .$ name )
243+ $ this ->container ->getDefinition ('bazinga_geocoder.provider. ' .$ name ),
245244 ));
246245 } else {
247246 $ chainProvider ->addMethodCall ('addProvider ' , array (new Reference ($ name )));
0 commit comments