private function _google ($parts)
	{
		if (!$this->_isAssoc($parts))
		{
			$parts = array_reduce(
				$parts,
				function ($a, $part) {
					$key     = $part['types'][0];
					$a[$key] = $part['long_name'];

					return $a;
				},
				[]
			);
		}

		foreach (PartsLegacy::$legacyKeys as $key)
			if (!array_key_exists($key, $parts))
				$parts[$key] = '';

		$this->number = $this->_join([
			$parts['subpremise'],
			$parts['premise'],
			$parts['street_number'],
		]);

		$this->address = $this->_join([
			$parts['route'],
			$parts['neighborhood'],
			$parts['sublocality_level_5'],
			$parts['sublocality_level_4'],
			$parts['sublocality_level_3'],
			$parts['sublocality_level_2'],
			$parts['sublocality_level_1'],
			$parts['sublocality'],
		]);

		$this->city = $this->_join([
			$parts['postal_town'],
			$parts['locality'],
		]);

		$this->postcode = $parts['postal_code'] ?? $parts['postal_code_prefix'];
		$this->county = $parts['administrative_area_level_2'];
		$this->state = $parts['administrative_area_level_1'];
		$this->country = $parts['country'];
	}
private function _google ($parts)
	{
		if (!$this->_isAssoc($parts))
		{
			$parts = array_reduce(
				$parts,
				function ($a, $part) {
					$key     = $part['types'][0];
					$a[$key] = $part['long_name'];

					return $a;
				},
				[]
			);
		}

		foreach (PartsLegacy::$legacyKeys as $key)
			if (!array_key_exists($key, $parts))
				$parts[$key] = '';

		$this->number = $this->_join([
			$parts['subpremise'],
			$parts['premise'],
			$parts['street_number'],
		]);

		$this->address = $this->_join([
			$parts['route'],
			$parts['neighborhood'],
			$parts['sublocality_level_5'],
			$parts['sublocality_level_4'],
			$parts['sublocality_level_3'],
			$parts['sublocality_level_2'],
			$parts['sublocality_level_1'],
			$parts['sublocality'],
		]);

		$this->city = $this->_join([
			$parts['postal_town'],
			$parts['locality'],
		]);

		$this->postcode = $parts['postal_code'] ?? $parts['postal_code_prefix'];
		$this->county = $parts['administrative_area_level_2'];
		$this->state = $parts['administrative_area_level_1'];
		$this->country = $parts['country'];
	}
private function _google ( $ parts ) { if ( ! $ this -> _isAssoc ( $ parts ) ) { $ parts = array_reduce ( $ parts , function ( $ a , $ part ) { $ key = $ part [ 'types' ] [ 0 ] ; $ a [ $ key ] = $ part [ 'long_name' ] ; return $ a ; } , [ ] ) ; } foreach ( PartsLegacy :: $ legacyKeys as $ key ) if ( ! array_key_exists ( $ key , $ parts ) ) $ parts [ $ key ] = '' ; $ this -> number = $ this -> _join ( [ $ parts [ 'subpremise' ] , $ parts [ 'premise' ] , $ parts [ 'street_number' ] , ] ) ; $ this -> address = $ this -> _join ( [ $ parts [ 'route' ] , $ parts [ 'neighborhood' ] , $ parts [ 'sublocality_level_5' ] , $ parts [ 'sublocality_level_4' ] , $ parts [ 'sublocality_level_3' ] , $ parts [ 'sublocality_level_2' ] , $ parts [ 'sublocality_level_1' ] , $ parts [ 'sublocality' ] , ] ) ; $ this -> city = $ this -> _join ( [ $ parts [ 'postal_town' ] , $ parts [ 'locality' ] , ] ) ; $ this -> postcode = $ parts [ 'postal_code' ] ?? $ parts [ 'postal_code_prefix' ] ; $ this -> county = $ parts [ 'administrative_area_level_2' ] ; $ this -> state = $ parts [ 'administrative_area_level_1' ] ; $ this -> country = $ parts [ 'country' ] ; }
Parse Google parts

@param $parts
Parse Google parts