class GoogleProvider extends AbstractProvider

Properties

protected Client $httpClient

The cache lifetime.

from  AbstractProvider
protected float|int $cacheLifetime

The cache lifetime.

from  AbstractProvider
protected $logs from  AbstractProvider
protected array $config

Methods

string
getName()

Returns the provider name.

Collection
geocodeQuery(GeoQueryInterface $query)

Handle the geocoder request.

Collection
reverseQuery(GeoQueryInterface $query)

Handle the reverse geocoding request.

Distance|null
distance(DistanceInterface $distance)

No description

Client
getHttpClient()

No description

$this
forgetCache()

Forget the repository cache.

getCacheKey()

No description

$this
setCacheLifetime(float|int $cacheLifetime)

Set the repository cache lifetime.

float|int
getCacheLifetime()

Get the repository cache lifetime.

cacheCallback($cacheKey, Closure $closure)

No description

Repository
getCacheDriver()

No description

log($message)

No description

getLogs()

No description

__construct(Client $client, array $config)

No description

hydrateResponse($response, int $limit)

No description

requestGeocodingUrl($url, GeoQueryInterface $query)

No description

requestDistanceUrl($url, DistanceInterface $query)

No description

mixed
parseResponse(ResponseInterface $response)

Decode the response content and validate it to make sure it does not have any errors.

string
prependGeocodeQuery(GeoQueryInterface $query, $url)

No description

string
prependReverseQuery(GeoQueryInterface $query, $url)

No description

string
prependDistanceQuery(DistanceInterface $distance, string $url)

No description

parseCoordinates(Location $address, $geometry)

No description

parseAddressComponents(Location $address, $components)

No description

parseAddressComponent(Location $address, $type, $component)

No description

serializeComponents($components)

No description

Details

at line 28
string getName()

Returns the provider name.

Return Value

string

at line 33
Collection geocodeQuery(GeoQueryInterface $query)

Handle the geocoder request.

Parameters

GeoQueryInterface $query

Return Value

Collection

at line 59
Collection reverseQuery(GeoQueryInterface $query)

Handle the reverse geocoding request.

Parameters

GeoQueryInterface $query

Return Value

Collection

at line 89
Distance|null distance(DistanceInterface $distance)

No description

Parameters

DistanceInterface $distance

Return Value

Distance|null

in AbstractProvider at line 56
protected Client getHttpClient()

No description

Return Value

Client

in AbstractProvider at line 70
$this forgetCache()

Forget the repository cache.

Return Value

$this

in AbstractProvider at line 80
getCacheKey()

No description

in AbstractProvider at line 92
$this setCacheLifetime(float|int $cacheLifetime)

Set the repository cache lifetime.

Parameters

float|int $cacheLifetime

Return Value

$this

in AbstractProvider at line 104
float|int getCacheLifetime()

Get the repository cache lifetime.

Return Value

float|int

in AbstractProvider at line 111
protected cacheCallback($cacheKey, Closure $closure)

No description

Parameters

$cacheKey
Closure $closure

in AbstractProvider at line 121
protected Repository getCacheDriver()

No description

Return Value

Repository

in AbstractProvider at line 130
log($message)

No description

Parameters

$message

in AbstractProvider at line 141
AbstractProvider resetLogs()

No description

Return Value

AbstractProvider $this

in AbstractProvider at line 148
getLogs()

No description

at line 22
__construct(Client $client, array $config)

No description

Parameters

Client $client
array $config

at line 116
protected hydrateResponse($response, int $limit)

No description

Parameters

$response
int $limit

at line 144
protected requestGeocodingUrl($url, GeoQueryInterface $query)

No description

Parameters

$url
GeoQueryInterface $query

at line 166
protected requestDistanceUrl($url, DistanceInterface $query)

No description

Parameters

$url
DistanceInterface $query

at line 194
protected mixed parseResponse(ResponseInterface $response)

Decode the response content and validate it to make sure it does not have any errors.

Parameters

ResponseInterface $response

Return Value

mixed

result from json_decode()

Exceptions

GeoliteException

at line 224
protected string prependGeocodeQuery(GeoQueryInterface $query, $url)

No description

Parameters

GeoQueryInterface $query
$url

Return Value

string

at line 242
protected string prependReverseQuery(GeoQueryInterface $query, $url)

No description

Parameters

GeoQueryInterface $query
$url

Return Value

string

at line 253
protected string prependDistanceQuery(DistanceInterface $distance, string $url)

No description

Parameters

DistanceInterface $distance
string $url

Return Value

string

at line 279
protected parseCoordinates(Location $address, $geometry)

No description

Parameters

Location $address
$geometry

at line 311
protected parseAddressComponents(Location $address, $components)

No description

Parameters

Location $address
$components

at line 320
protected parseAddressComponent(Location $address, $type, $component)

No description

Parameters

Location $address
$type
$component

at line 379
protected serializeComponents($components)

No description

Parameters

$components