smartystreets / smartystreets-php-sdk

The official client libraries for accessing SmartyStreets APIs from the PHP Hypertext Processor.
https://smartystreets.com/docs/sdk/php
Apache License 2.0
28 stars 15 forks source link

Fix duplicate definition of GeolocateType constants #27

Closed damiantw closed 3 years ago

damiantw commented 3 years ago

Since the recent release of this package that added the US_Autocomplete_Pro namespace I've been receiving error ErrorException: Constant GEOLOCATE_TYPE_CITY already defined when I instantiate a SmartyStreets\PhpSdk\US_Street\Client instance using the SmartyStreets\PhpSdk\ClientBuilder buildUsStreetApiClient function.

This is due to the identical constants defined in SmartyStreets\PhpSdk\US_Autocomplete\GeolocateType and SmartyStreets\PhpSdk\US_Autocomplete_Pro\GeolocateType.

This PR resolves this issue by adding checks to each of these classes to ensure the constants have not already been defined.

DuncanBeutler commented 3 years ago

Changes can be accessed on 4.13.3. Thank you for raising the issue!