Basic usage

We are trying to keep our API fluent and expressive. Most methods are self explanatory.

use MenaraSolutions\Geographer\Earth;
use MenaraSolutions\Geographer\Country;

// Default entry point is our beautiful planet
$earth = new Earth();

// Give me a list of all countries please

// Oh, but please try to use short versions, eg. USA instead of United States of America

// Now please give me all states of Thailand
$thailand = $earth->getCountries()->findOne(['code' => 'TH']); // You can call find on collection
$thailand = $earth->findOne(['code' => 'TH']); // Or right away on division
$thailand = $earth->findOneByCode('TH'); // Alternative shorter syntax

// Oh, but I want them in Russian

// Oh, but I want them inflicted to 'in' form (eg. 'in Spain')

// Or if you prefer constants for the sake of IDE auto-complete

// What's the capital and do you have a geonames ID for that? Or maybe latitude and longitude?
$capital = $thailand->getCapital();