public static function createGeocoder( $country_code = CountryCodes::US, $provider_code = GeocodingProviders::GOOGLE_MAPS ) {
    if ( CountryCodes::US != $country_code ) {
      throw new GeocodingException( 'PostalCode geocoder for country \'' . $country_code . '\' not found.' );
    }

    $geocoding_provider = static::createGeocodingProvider( $provider_code );

    return new \BlueBlazeAssociates\Geocoding\PostalCodes\Geocoders\USPostalCodeGeocoder( $geocoding_provider );

    // TODO Create a map between country codes and implementation class names.
  }
public static function createGeocoder( $country_code = CountryCodes::US, $provider_code = GeocodingProviders::GOOGLE_MAPS ) {
    if ( CountryCodes::US != $country_code ) {
      throw new GeocodingException( 'PostalCode geocoder for country \'' . $country_code . '\' not found.' );
    }

    $geocoding_provider = static::createGeocodingProvider( $provider_code );

    return new \BlueBlazeAssociates\Geocoding\PostalCodes\Geocoders\USPostalCodeGeocoder( $geocoding_provider );

    // TODO Create a map between country codes and implementation class names.
  }
public static function createGeocoder ( $ country_code = CountryCodes :: US , $ provider_code = GeocodingProviders :: GOOGLE_MAPS ) { if ( CountryCodes :: US != $ country_code ) { throw new GeocodingException ( 'PostalCode geocoder for country \'' . $ country_code . '\' not found.' ) ; } $ geocoding_provider = static :: createGeocodingProvider ( $ provider_code ) ; return new \ BlueBlazeAssociates \ Geocoding \ PostalCodes \ Geocoders \ USPostalCodeGeocoder ( $ geocoding_provider ) ; // TODO Create a map between country codes and implementation class names. }
Create a country specific geocoder for postal codes.

@param CountryCode $countrycode

@return BasePostalCodeGeocoder

@throws GeocodingException Throws exception if country code isn't supported.
@throws GeocodingException Throws exception if geocoding provider can't be found.
Create a country specific geocoder for postal codes .