<?php
namespace Misuzu\Net;

use Misuzu\MisuzuContext;

// remains for now for backwards compatibility with existing ::create methods
// plan is for those ::create methods to Fucking Die so that's fine for now

final class IPAddress {
    private static MisuzuContext $context;

    public static function init(MisuzuContext $ctx): void {
        self::$context = $ctx;
    }

    public static function country(string $address, string $fallback = 'XX'): string {
        return self::$context->getGeoIP()->getIsoCountryCode($address, $fallback);
    }
}
