Skip to content

Commit 4562c12

Browse files
authored
Merge pull request #263 from sarcher/deprecation-fix
Only trigger provider deprecation notices when they are explicitly configured -- #259.
2 parents aa961b2 + 32c8264 commit 4562c12

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ProviderFactory/GeoIPsFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
use Http\Discovery\HttpClientDiscovery;
1818
use Symfony\Component\OptionsResolver\OptionsResolver;
1919

20-
@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);
21-
2220
/**
2321
* @deprecated since 5.6, to be removed in 6.0. See https://github.com/geocoder-php/Geocoder/issues/965
2422
*/
@@ -30,6 +28,8 @@ final class GeoIPsFactory extends AbstractFactory
3028

3129
protected function getProvider(array $config): Provider
3230
{
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+
3333
$httplug = $config['httplug_client'] ?: HttpClientDiscovery::find();
3434

3535
return new GeoIPs($httplug, $config['api_key']);

ProviderFactory/MapzenFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
use Http\Discovery\HttpClientDiscovery;
1818
use Symfony\Component\OptionsResolver\OptionsResolver;
1919

20-
@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);
21-
2220
/**
2321
* @deprecated since 5.6, to be removed in 6.0. See https://github.com/geocoder-php/Geocoder/issues/808
2422
*/
@@ -30,6 +28,8 @@ final class MapzenFactory extends AbstractFactory
3028

3129
protected function getProvider(array $config): Provider
3230
{
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+
3333
$httplug = $config['httplug_client'] ?: HttpClientDiscovery::find();
3434

3535
return new Mapzen($httplug, $config['api_key']);

0 commit comments

Comments
 (0)