lib/AktiveMerchant/Common/CountryCode.php
private function detectFormat()
    {
        if (preg_match('/^[[:alpha:]]{2}$/', $this->value)) {
            $this->format = 'alpha2';
        } elseif (preg_match('/^[[:alpha:]]{3}$/', $this->value)) {
            $this->format = 'alpha3';
        } elseif (preg_match('/^[[:digit:]]{3}$/', $this->value)) {
            $this->format = 'numeric';
        } else {
            throw new Exception("The country code is not formatted correctly {$this->value}");
        }
    }
private function detectFormat()
    {
        if (preg_match('/^[[:alpha:]]{2}$/', $this->value)) {
            $this->format = 'alpha2';
        } elseif (preg_match('/^[[:alpha:]]{3}$/', $this->value)) {
            $this->format = 'alpha3';
        } elseif (preg_match('/^[[:digit:]]{3}$/', $this->value)) {
            $this->format = 'numeric';
        } else {
            throw new Exception("The country code is not formatted correctly {$this->value}");
        }
    }
private function detectFormat ( ) { if ( preg_match ( '/^[[:alpha:]]{2}$/' , $ this -> value ) ) { $ this -> format = 'alpha2' ; } elseif ( preg_match ( '/^[[:alpha:]]{3}$/' , $ this -> value ) ) { $ this -> format = 'alpha3' ; } elseif ( preg_match ( '/^[[:digit:]]{3}$/' , $ this -> value ) ) { $ this -> format = 'numeric' ; } else { throw new Exception ( "The country code is not formatted correctly {$this->value}" ) ; } }
Detects the format of country name from the given value.

@throws \Exception

@return void
Detects the format of country name from the given value .