/** * Registers a provider. * * @param ProviderInterface $provider * * @return GeocoderInterface */ public function registerProvider(ProviderInterface $provider) { if (null !== $provider) { $this->providers[$provider->getName()] = $provider; } return $this; }
/** * {@inheritDoc} */ public function getReversedData(array $coordinates) { $key = crc32(serialize($this->locale . json_encode($coordinates))); if (false !== ($data = $this->cache->fetch($key))) { return unserialize($data); } $data = $this->provider->getReversedData($coordinates); $this->cache->save($key, serialize($data), $this->lifetime); return $data; }