ProviderFactory/ArcGISOnlineFactory.php 1 location
|
@@ 20-43 (lines=24) @@
|
17 |
|
use Http\Discovery\HttpClientDiscovery; |
18 |
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
19 |
|
|
20 |
|
final class ArcGISOnlineFactory extends AbstractFactory |
21 |
|
{ |
22 |
|
protected static $dependencies = [ |
23 |
|
['requiredClass' => ArcGISOnline::class, 'packageName' => 'geocoder-php/arcgis-online-provider'], |
24 |
|
]; |
25 |
|
|
26 |
|
protected function getProvider(array $config): Provider |
27 |
|
{ |
28 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
29 |
|
|
30 |
|
return new ArcGISOnline($httplug, $config['source_country']); |
31 |
|
} |
32 |
|
|
33 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
34 |
|
{ |
35 |
|
$resolver->setDefaults([ |
36 |
|
'httplug_client' => null, |
37 |
|
'source_country' => null, |
38 |
|
]); |
39 |
|
|
40 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
41 |
|
$resolver->setAllowedTypes('source_country', ['string', 'null']); |
42 |
|
} |
43 |
|
} |
44 |
|
|
ProviderFactory/BingMapsFactory.php 1 location
|
@@ 20-43 (lines=24) @@
|
17 |
|
use Http\Discovery\HttpClientDiscovery; |
18 |
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
19 |
|
|
20 |
|
final class BingMapsFactory extends AbstractFactory |
21 |
|
{ |
22 |
|
protected static $dependencies = [ |
23 |
|
['requiredClass' => BingMaps::class, 'packageName' => 'geocoder-php/bing-maps-provider'], |
24 |
|
]; |
25 |
|
|
26 |
|
protected function getProvider(array $config): Provider |
27 |
|
{ |
28 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
29 |
|
|
30 |
|
return new BingMaps($httplug, $config['api_key']); |
31 |
|
} |
32 |
|
|
33 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
34 |
|
{ |
35 |
|
$resolver->setDefaults([ |
36 |
|
'httplug_client' => null, |
37 |
|
]); |
38 |
|
|
39 |
|
$resolver->setRequired('api_key'); |
40 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
41 |
|
$resolver->setAllowedTypes('api_key', ['string']); |
42 |
|
} |
43 |
|
} |
44 |
|
|
ProviderFactory/FreeGeoIpFactory.php 1 location
|
@@ 20-43 (lines=24) @@
|
17 |
|
use Http\Discovery\HttpClientDiscovery; |
18 |
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
19 |
|
|
20 |
|
final class FreeGeoIpFactory extends AbstractFactory |
21 |
|
{ |
22 |
|
protected static $dependencies = [ |
23 |
|
['requiredClass' => FreeGeoIp::class, 'packageName' => 'geocoder-php/free-geoip-provider'], |
24 |
|
]; |
25 |
|
|
26 |
|
protected function getProvider(array $config): Provider |
27 |
|
{ |
28 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
29 |
|
|
30 |
|
return new FreeGeoIp($httplug, $config['base_url']); |
31 |
|
} |
32 |
|
|
33 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
34 |
|
{ |
35 |
|
$resolver->setDefaults([ |
36 |
|
'httplug_client' => null, |
37 |
|
'base_url' => 'https://freegeoip.app/json/%s', |
38 |
|
]); |
39 |
|
|
40 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
41 |
|
$resolver->setAllowedTypes('base_url', ['string']); |
42 |
|
} |
43 |
|
} |
44 |
|
|
ProviderFactory/GeoIPsFactory.php 1 location
|
@@ 23-48 (lines=26) @@
|
20 |
|
/** |
21 |
|
* @deprecated since 5.6, to be removed in 6.0. See https://github.com/geocoder-php/Geocoder/issues/965 |
22 |
|
*/ |
23 |
|
final class GeoIPsFactory extends AbstractFactory |
24 |
|
{ |
25 |
|
protected static $dependencies = [ |
26 |
|
['requiredClass' => GeoIPs::class, 'packageName' => 'geocoder-php/geoips-provider'], |
27 |
|
]; |
28 |
|
|
29 |
|
protected function getProvider(array $config): Provider |
30 |
|
{ |
31 |
|
@trigger_error('Bazinga\GeocoderBundle\ProviderFactory\GeoIPsFactory is deprecated since 5.6, to be removed in 6.0. See https://github.com/geocoder-php/Geocoder/issues/965', E_USER_DEPRECATED); |
32 |
|
|
33 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
34 |
|
|
35 |
|
return new GeoIPs($httplug, $config['api_key']); |
36 |
|
} |
37 |
|
|
38 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
39 |
|
{ |
40 |
|
$resolver->setDefaults([ |
41 |
|
'httplug_client' => null, |
42 |
|
]); |
43 |
|
|
44 |
|
$resolver->setRequired('api_key'); |
45 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
46 |
|
$resolver->setAllowedTypes('api_key', ['string']); |
47 |
|
} |
48 |
|
} |
49 |
|
|
ProviderFactory/GeonamesFactory.php 1 location
|
@@ 20-43 (lines=24) @@
|
17 |
|
use Http\Discovery\HttpClientDiscovery; |
18 |
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
19 |
|
|
20 |
|
final class GeonamesFactory extends AbstractFactory |
21 |
|
{ |
22 |
|
protected static $dependencies = [ |
23 |
|
['requiredClass' => Geonames::class, 'packageName' => 'geocoder-php/geonames-provider'], |
24 |
|
]; |
25 |
|
|
26 |
|
protected function getProvider(array $config): Provider |
27 |
|
{ |
28 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
29 |
|
|
30 |
|
return new Geonames($httplug, $config['username']); |
31 |
|
} |
32 |
|
|
33 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
34 |
|
{ |
35 |
|
$resolver->setDefaults([ |
36 |
|
'httplug_client' => null, |
37 |
|
]); |
38 |
|
|
39 |
|
$resolver->setRequired('username'); |
40 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
41 |
|
$resolver->setAllowedTypes('username', ['string']); |
42 |
|
} |
43 |
|
} |
44 |
|
|
ProviderFactory/GoogleMapsPlacesFactory.php 1 location
|
@@ 20-43 (lines=24) @@
|
17 |
|
use Http\Discovery\HttpClientDiscovery; |
18 |
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
19 |
|
|
20 |
|
final class GoogleMapsPlacesFactory extends AbstractFactory |
21 |
|
{ |
22 |
|
protected static $dependencies = [ |
23 |
|
['requiredClass' => GoogleMapsPlaces::class, 'packageName' => 'geocoder-php/google-maps-places-provider'], |
24 |
|
]; |
25 |
|
|
26 |
|
protected function getProvider(array $config): Provider |
27 |
|
{ |
28 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
29 |
|
|
30 |
|
return new GoogleMapsPlaces($httplug, $config['api_key']); |
31 |
|
} |
32 |
|
|
33 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
34 |
|
{ |
35 |
|
$resolver->setDefaults([ |
36 |
|
'httplug_client' => null, |
37 |
|
]); |
38 |
|
|
39 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
40 |
|
$resolver->setRequired(['api_key']); |
41 |
|
$resolver->setAllowedTypes('api_key', ['string']); |
42 |
|
} |
43 |
|
} |
44 |
|
|
ProviderFactory/IpstackFactory.php 1 location
|
@@ 20-43 (lines=24) @@
|
17 |
|
use Http\Discovery\HttpClientDiscovery; |
18 |
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
19 |
|
|
20 |
|
final class IpstackFactory extends AbstractFactory |
21 |
|
{ |
22 |
|
protected static $dependencies = [ |
23 |
|
['requiredClass' => Ipstack::class, 'packageName' => 'geocoder-php/ipstack-provider'], |
24 |
|
]; |
25 |
|
|
26 |
|
protected function getProvider(array $config): Provider |
27 |
|
{ |
28 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
29 |
|
|
30 |
|
return new Ipstack($httplug, $config['api_key']); |
31 |
|
} |
32 |
|
|
33 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
34 |
|
{ |
35 |
|
$resolver->setDefaults([ |
36 |
|
'httplug_client' => null, |
37 |
|
]); |
38 |
|
|
39 |
|
$resolver->setRequired('api_key'); |
40 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
41 |
|
$resolver->setAllowedTypes('api_key', ['string']); |
42 |
|
} |
43 |
|
} |
44 |
|
|
ProviderFactory/MapzenFactory.php 1 location
|
@@ 23-48 (lines=26) @@
|
20 |
|
/** |
21 |
|
* @deprecated since 5.6, to be removed in 6.0. See https://github.com/geocoder-php/Geocoder/issues/808 |
22 |
|
*/ |
23 |
|
final class MapzenFactory extends AbstractFactory |
24 |
|
{ |
25 |
|
protected static $dependencies = [ |
26 |
|
['requiredClass' => Mapzen::class, 'packageName' => 'geocoder-php/mapzen-provider'], |
27 |
|
]; |
28 |
|
|
29 |
|
protected function getProvider(array $config): Provider |
30 |
|
{ |
31 |
|
@trigger_error('Bazinga\GeocoderBundle\ProviderFactory\MapzenFactory is deprecated since 5.6, to be removed in 6.0. See https://github.com/geocoder-php/Geocoder/issues/808', E_USER_DEPRECATED); |
32 |
|
|
33 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
34 |
|
|
35 |
|
return new Mapzen($httplug, $config['api_key']); |
36 |
|
} |
37 |
|
|
38 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
39 |
|
{ |
40 |
|
$resolver->setDefaults([ |
41 |
|
'httplug_client' => null, |
42 |
|
]); |
43 |
|
|
44 |
|
$resolver->setRequired('api_key'); |
45 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
46 |
|
$resolver->setAllowedTypes('api_key', ['string']); |
47 |
|
} |
48 |
|
} |
49 |
|
|
ProviderFactory/OpenCageFactory.php 1 location
|
@@ 20-43 (lines=24) @@
|
17 |
|
use Http\Discovery\HttpClientDiscovery; |
18 |
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
19 |
|
|
20 |
|
final class OpenCageFactory extends AbstractFactory |
21 |
|
{ |
22 |
|
protected static $dependencies = [ |
23 |
|
['requiredClass' => OpenCage::class, 'packageName' => 'geocoder-php/open-cage-provider'], |
24 |
|
]; |
25 |
|
|
26 |
|
protected function getProvider(array $config): Provider |
27 |
|
{ |
28 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
29 |
|
|
30 |
|
return new OpenCage($httplug, $config['api_key']); |
31 |
|
} |
32 |
|
|
33 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
34 |
|
{ |
35 |
|
$resolver->setDefaults([ |
36 |
|
'httplug_client' => null, |
37 |
|
]); |
38 |
|
|
39 |
|
$resolver->setRequired('api_key'); |
40 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
41 |
|
$resolver->setAllowedTypes('api_key', ['string']); |
42 |
|
} |
43 |
|
} |
44 |
|
|
ProviderFactory/PickPointFactory.php 1 location
|
@@ 20-43 (lines=24) @@
|
17 |
|
use Http\Discovery\HttpClientDiscovery; |
18 |
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
19 |
|
|
20 |
|
final class PickPointFactory extends AbstractFactory |
21 |
|
{ |
22 |
|
protected static $dependencies = [ |
23 |
|
['requiredClass' => PickPoint::class, 'packageName' => 'geocoder-php/pickpoint-provider'], |
24 |
|
]; |
25 |
|
|
26 |
|
protected function getProvider(array $config): Provider |
27 |
|
{ |
28 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
29 |
|
|
30 |
|
return new PickPoint($httplug, $config['api_key']); |
31 |
|
} |
32 |
|
|
33 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
34 |
|
{ |
35 |
|
$resolver->setDefaults([ |
36 |
|
'httplug_client' => null, |
37 |
|
]); |
38 |
|
|
39 |
|
$resolver->setRequired('api_key'); |
40 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
41 |
|
$resolver->setAllowedTypes('api_key', ['string']); |
42 |
|
} |
43 |
|
} |
44 |
|
|
ProviderFactory/TomTomFactory.php 1 location
|
@@ 20-43 (lines=24) @@
|
17 |
|
use Http\Discovery\HttpClientDiscovery; |
18 |
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
19 |
|
|
20 |
|
final class TomTomFactory extends AbstractFactory |
21 |
|
{ |
22 |
|
protected static $dependencies = [ |
23 |
|
['requiredClass' => TomTom::class, 'packageName' => 'geocoder-php/tomtom-provider'], |
24 |
|
]; |
25 |
|
|
26 |
|
protected function getProvider(array $config): Provider |
27 |
|
{ |
28 |
|
$httplug = $config['httplug_client'] ?: $this->httpClient ?? HttpClientDiscovery::find(); |
29 |
|
|
30 |
|
return new TomTom($httplug, $config['api_key']); |
31 |
|
} |
32 |
|
|
33 |
|
protected static function configureOptionResolver(OptionsResolver $resolver) |
34 |
|
{ |
35 |
|
$resolver->setDefaults([ |
36 |
|
'httplug_client' => null, |
37 |
|
]); |
38 |
|
|
39 |
|
$resolver->setRequired('api_key'); |
40 |
|
$resolver->setAllowedTypes('httplug_client', ['object', 'null']); |
41 |
|
$resolver->setAllowedTypes('api_key', ['string']); |
42 |
|
} |
43 |
|
} |
44 |
|
|