geolocation-8.x-3.x-dev/modules/geolocation_google_maps/src/Plugin/geolocation/GeocoderCountryFormatting/Italy.php
modules/geolocation_google_maps/src/Plugin/geolocation/GeocoderCountryFormatting/Italy.php
<?php
namespace Drupal\geolocation_google_maps\Plugin\geolocation\GeocoderCountryFormatting;
use Drupal\geolocation\Attribute\GeocoderCountryFormatting;
use Drupal\geolocation_google_maps\GoogleCountryFormattingBase;
/**
* Provides address formatting.
*/
#[GeocoderCountryFormatting(
id: 'google_it',
countryCode: 'it',
geocoder: 'google_geocoding_api'
)]
class Italy extends GoogleCountryFormattingBase {
/**
* {@inheritdoc}
*/
public function format(array $atomics): ?array {
$address_elements = parent::format($atomics);
if (
isset($atomics['county'])
&& $atomics['county']
) {
$address_elements['administrativeArea'] = $atomics['countyCode'];
}
return $address_elements;
}
}
