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 . '\'.');
        }
    }