8000 Our interfaces · Issue #574 · geocoder-php/Geocoder · GitHub
[go: up one dir, main page]

Skip to content
Our interfaces #574
Closed
Closed
@Nyholm

Description

@Nyholm

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 {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0