Skip to content

Commit c7ad49f

Browse files
grulexАлександр Грушко
authored andcommitted
Adding api_key for the YandexFactory
Package geocoder-php/yandex-provider updated, we can use api_key for yandex-geocoder
1 parent cfda185 commit c7ad49f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ProviderFactory/YandexFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ protected function getProvider(array $config): Provider
2727
{
2828
$httplug = $config['httplug_client'] ?: HttpClientDiscovery::find();
2929

30-
return new Yandex($httplug, $config['toponym']);
30+
return new Yandex($httplug, $config['toponym'], $config['api_key']);
3131
}
3232

3333
protected static function configureOptionResolver(OptionsResolver $resolver)
3434
{
3535
$resolver->setDefaults([
3636
'httplug_client' => null,
3737
'toponym' => null,
38+
'api_key' => null,
3839
]);
3940

4041
$resolver->setAllowedTypes('httplug_client', ['object', 'null']);
4142
$resolver->setAllowedTypes('toponym', ['string', 'null']);
43+
$resolver->setAllowedTypes('api_key', ['string', 'null']);
4244
}
4345
}

0 commit comments

Comments
 (0)