Closed
Description
Currently we have the following interfaces for geocoder/providers:
interface LocaleAwareProvider extends Provider {
public function getLocale();
public function setLocale($locale);
}
interface Provider extends Geocoder {
public function getName();
}
interface Geocoder {
public function geocode($value);
public function reverse($latitude, $longitude);
public function getLimit();
public function limit($limit);
}
Is there a reason why a Geocoder cannot have a name? If we should add support for a Location::providedBy
(#490) I think all Geocoder should have a name.
I would also like to hear voices about the interface inheritance. Must the LocaleAwareProvider
really be a Provider
?
I suggest the following:
interface LocaleAware {
public function getLocale();
public function setLocale($locale);
}
interface Geocoder {
public function geocode($value);
public function reverse($latitude, $longitude);
public function getLimit();
public function limit($limit);
public function getName();
}
I suggest we start to add interfaces for features. In #501 I suggested to add a BoundsAware
.
interface BoundsAware {
public function setBounds(Bounds $bounds);
}
I do also want an interface for providers that supports IP addresses. (Right now we have no way to tell)
interface IpAddressGeocoder {
}