The PhoneNumberOfflineGeocoder is implemented as a singleton. Therefore, calling this method multiple times will only result in one instance being created.
public static getInstance ( string $mappingDir = self::MAPPING_DATA_DIRECTORY ) : |
||
$mappingDir | string | (Optional) Mapping Data Directory |
return |
public static function getInstance($mappingDir = self::MAPPING_DATA_DIRECTORY)
{
if (static::$instance === null) {
static::$instance = new static($mappingDir);
}
return static::$instance;
}
public function setUp() { PhoneNumberUtil::resetInstance(); PhoneNumberOfflineGeocoder::resetInstance(); $this->phoneUtil = PhoneNumberUtil::getInstance(); $this->geocoder = PhoneNumberOfflineGeocoder::getInstance(); }