Skip to content

Conversation

@Nyholm
Copy link
Member

@Nyholm Nyholm commented Jan 3, 2017

As discussed in #574

@Nyholm Nyholm added this to the 4.0.0 milestone Jan 3, 2017
@willdurand
Copy link
Member

willdurand commented Jan 3, 2017

What happens if we have a provider that is both locale- + bound-aware?

@Nyholm
Copy link
Member Author

Nyholm commented Jan 3, 2017

It has to implement two interfaces. You will run into an issue when you typehint for it:

function (LocaleAwareProvider $provider) {
  if ($provider instanceof BoundsAwareProvider) {
    // Set bounds
  }
}

I do not know a better way of solving this. To create Superinterface extends LocaleAwareProvider, BoundsAwareProvider is wrong... To include all methods in one interface would violate interface segregation principle.

Note that this is only an "issue" in third party libraries. An application developer would write:

function (ConcreateProvider $provider) {
    // Set bounds

}

@Nyholm
Copy link
Member Author

Nyholm commented May 20, 2017

This is the wrong approach. We should use GeocodeQuery::withBounds

@Nyholm Nyholm closed this May 20, 2017
@Nyholm Nyholm deleted the patch-bounds branch May 20, 2017 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants