public static function valueOf($code = self::NONE)
    {
        if (self::isValidCode($code)) {
            $details = self::getDetails($code);
            $code = $details['code'];
            $isoStatus = $details['isoStatus'];
            $decimalDigits = $details['decimalDigits'];
            $name = $details['name'];

            return new Currency($code, $isoStatus, $decimalDigits, $name);
        } else {
            throw new \InvalidArgumentException('Unknown currency code \'' . $code . '\'.');
        }
    }
public static function valueOf($code = self::NONE)
    {
        if (self::isValidCode($code)) {
            $details = self::getDetails($code);
            $code = $details['code'];
            $isoStatus = $details['isoStatus'];
            $decimalDigits = $details['decimalDigits'];
            $name = $details['name'];

            return new Currency($code, $isoStatus, $decimalDigits, $name);
        } else {
            throw new \InvalidArgumentException('Unknown currency code \'' . $code . '\'.');
        }
    }
public static function valueOf ( $ code = self :: NONE ) { if ( self :: isValidCode ( $ code ) ) { $ details = self :: getDetails ( $ code ) ; $ code = $ details [ 'code' ] ; $ isoStatus = $ details [ 'isoStatus' ] ; $ decimalDigits = $ details [ 'decimalDigits' ] ; $ name = $ details [ 'name' ] ; return new Currency ( $ code , $ isoStatus , $ decimalDigits , $ name ) ; } else { throw new \ InvalidArgumentException ( 'Unknown currency code \'' . $ code . '\'.' ) ; } }
Creates a new instance for the given code.

@param string $code the three-letter currency code

@return Currency

@throws \InvalidArgumentException if the code is unknown
Creates a new instance for the given code .