Monarobase\CountryList\CountryList::__construct PHP Method

__construct() public method

Constructor.
public __construct ( string | null $dataDir = null )
$dataDir string | null Path to the directory containing countries data
    public function __construct($dataDir = null)
    {
        if (!isset($dataDir)) {
            $r = new \ReflectionClass('Umpirsky\\Country\\Builder\\Builder');
            $dataDir = sprintf('%s/../../../../country', dirname($r->getFileName()));
        }
        if (!is_dir($dataDir)) {
            throw new \RuntimeException(sprintf('Unable to locate the country data directory at "%s"', $dataDir));
        }
        $this->dataDir = realpath($dataDir);
    }