Gets the ISO3166 alpha-3 code that corresponds to the provided alpha-2 code.

@param string $alpha2
@return string|null
175905
public function convertAlpha2ToAlpha3($alpha2)
    {
        if (!isset(self::$codes[$alpha2])) {
            return null;
        }

        return self::$codes[$alpha2];
    }
1095359
public static function getCurrencySymbol($isocode) {
		return empty(self::$currencySymbols[$isocode])?$isocode:self::$currencySymbols[$isocode];
	}
444836
public function getNumber($number)
    {
        switch ($this->_type) {
            case self::TYPE_ALPHA_UPPER:
                return $this->getAlphaNumber($number);
            case self::TYPE_ALPHA_LOWER:
                return $this->getAlphaNumber($number, true);
            case self::TYPE_ROMAN_UPPER:
                return $this->getRomanNumber($number);
            case self::TYPE_ROMAN_LOWER:
                return $this->getRomanNumber($number, true);
            // default is alpha
            default:
                return $number;
        }
    }
1007792
private function _getCode(){
        $code = null;
        //try{
            $text = $this->text;
            $textColor = new CINColor($this->foregroundColor);
            $backgroudColor = new CINColor($this->backgroundColor);
            $fontPath = isset($this->font) ? $this->font : $this->_getDefaultFont();

            $font = new CINFontFile($fontPath, (is_int($this->fontSize)) ? $this->fontSize : 18);

            $codeClass = "\\CodeItNow\\BarcodeBundle\\Generator\\".$this->barcodeType;
            $code = new $codeClass();
            if($this->scale){
                $code->setScale($this->scale); // Resolution
            }
            if($this->thickness){
                $code->setThickness($this->thickness); // Thickness
            }
            if($this->label !== FALSE){
                $code->setLabel($this->label);
            }
            if($this->noLengthLimit){
                $code->setNoLengthLimit($this->noLengthLimit);
            }
            if($this->allowsUnknownIdentifier){
                $code->setAllowsUnknownIdentifier($this->allowsUnknownIdentifier);
            }
            $code->setForegroundColor($textColor); // Color of bars
            $code->setBackgroundColor($backgroudColor); // Color of spaces
            $code->setFont($font); // Font (or 0)
            $code->parse($text); // Text
        //} catch (\Exception $ex) {
            
        //}
        return $code;
    }
1343239
public static function get($code)
    {
        try {
            return static::getByAlpha2($code);
        } catch (OutOfBoundsException $e) {
            try {
                return static::getByAlpha3($code);
            } catch (OutOfBoundsException $e) {
                try {
                    return static::getByNumeric3($code);
                } catch (OutOfBoundsException $e) {
                    throw new OutOfBoundsException("The code \"{$code}\" is not listed in ISO 4217");
                }
            }
        }
    }
940696
public function findByUnicode($unicode = null) : string
    {
        if (is_null($unicode)) {
            throw IsNull::create("Please provide a valid UTF-8 Unicode value");
        }

        $emojis = array_flip($this->getEmojis());

        if (! array_key_exists($unicode, $emojis)) {
            throw UnknownUnicode::create($unicode);
        }

        return $emojis[$unicode];
    }
309198
public static function alphanumeric ($value)
    {
        $res = preg_match('/^[0-9a-zA-Z]+$/', $value);
        if (false === $res) {
            throw new Exception("Unable to verify alphanumericy: $value");
        } elseif (0 == $res) {
            return false;
        } else {
            return true;
        }
    }
1128764
public static function checkErrorCode($pValue = null)
    {
        $pValue = (string) $pValue;

        if (!array_key_exists($pValue, self::$errorCodes)) {
            $pValue = '#NULL!';
        }

        return $pValue;
    }
653889
public function getConfirmCode()
    {
        $confirmCodeAttribute = $this->confirmCodeAttribute;
        return (is_string($confirmCodeAttribute) && !empty($confirmCodeAttribute)) ? $this->$confirmCodeAttribute : null;
    }
946123
public function alphaNumeric($field)
    {
        return (ctype_alnum((string)$this->get($field)) === true) ?: $this->error($field, __FUNCTION__);
    }
511558
public function getNumericCountry()
    {
        $country = $this->getCountry();

        if ( !is_null($country) && !is_numeric($country) )
        {
            $iso3166 = new ISO3166();

            if ( strlen($country) == 2 )
            {
                $country = $iso3166->getByAlpha2($country)['numeric'];
            }
            elseif ( strlen($country) == 3 )
            {
                $country = $iso3166->getByAlpha3($country)['numeric'];
            }
            else
            {
                throw new InvalidRequestException("The country parameter must be ISO 3166-1 numeric, aplha2 or alpha3.");
            }
        }

        return $country;
    }
786648
public static function getCode($val)
    {
        if (self::$_languageFlip === array()) {
            self::$_languageFlip = array_flip(self::$_languages);
        }
        if (array_key_exists($val, self::$_languageFlip)) {
            return strtolower(self::$_languageFlip[$val]);
        }
        return null;
    }
1058241
public function getByCode($code)
    {
        foreach ($this->currencies as $currency) {
            if (0 === strcasecmp($code, $currency['alpha3']) ||
                0 === strcasecmp($code, $currency['numeric'])) {
                return $currency;
            }
        }

        throw new \OutOfBoundsException('ISO 4217 does not contain: '.$code);
    }
783160
public function getCode($instanceName) {
		if (isset($this->declaredInstances[$instanceName]["code"])) {
			return $this->declaredInstances[$instanceName]["code"];
		}
		return null;
	}
323176
public function getAuthorizationCode($code)
    {
        $code = $this->getObjectByType('code_table',$code);

        return is_null($code) ? false : $code;
    }
611478
public function getIsoAlpha2FromName($name)
    {
        // First try and fetch from alpha3 code.
        try {
            return $this->iso->alpha3($this->getCodeFromCountry($name))['alpha2'];
        } catch (OutOfBoundsException $e) {
            // Nothing code continues.
        }

        // Couldn't getch alpha3 from code try from country name.
        try {
            return $this->iso->name($name)['alpha2'];
        } catch (OutOfBoundsException $e) {
            $this->logger->warning("Can't get valid alpha2 code for country '$name'");
        }

        return "OT";
    }
462411
public static function alphaNumChars()
    {
        return self::oneOf(
            self::choose(48, 57),
            self::choose(65, 90),
            self::choose(97, 122)
        )->fmap('chr');
    }