alcohol / iso3166

A PHP library providing ISO 3166-1 data.
https://iso3166.thephpleague.com
MIT License
640 stars 59 forks source link

public visibility for getBy #26

Closed rap2hpoutre closed 7 years ago

rap2hpoutre commented 7 years ago

I was looking for a lib that get a country code by country name and found this one. Unfortunately, it only works from a country code to a country name. I think it could be great to search by anything. That's why I changed the visibility. One other way may be to add a getByName method but I'm not sure it's better.

alcohol commented 7 years ago

Sorry, it's private on purpose.

rap2hpoutre commented 7 years ago

Ok and what about a getByName ?

alcohol commented 7 years ago

Well, it does not make much sense honestly, since name depends on locale. The default dataset just happens to be English. Name is not actually a part of the ISO standard either, unlike alpha2/alpha3/numeric.

alcohol commented 7 years ago

You can always wrap an instance of the class, call getAll(), and search through the returned dataset :-)

rap2hpoutre commented 7 years ago

You can always wrap an instance of the class, call getAll(), and search through the returned dataset :-)

That's what I done :)