protected static function getDefinition($code)
    {
        $currencies = self::getDefinitions();
        $nodes = $currencies->xpath("//currency[@code='{$code}']");
        if (empty($nodes)) {
            throw new \InvalidArgumentException("Unknown currency: {$code}");
        }

        $cNode = $nodes[0];

        $def = array(
            self::createSymbol($cNode->symbol, $code),
            intval($cNode->exponent),
            self::createName($cNode),
        );

        return $def;
    }
protected static function getDefinition($code)
    {
        $currencies = self::getDefinitions();
        $nodes = $currencies->xpath("//currency[@code='{$code}']");
        if (empty($nodes)) {
            throw new \InvalidArgumentException("Unknown currency: {$code}");
        }

        $cNode = $nodes[0];

        $def = array(
            self::createSymbol($cNode->symbol, $code),
            intval($cNode->exponent),
            self::createName($cNode),
        );

        return $def;
    }
protected static function getDefinition ( $ code ) { $ currencies = self :: getDefinitions ( ) ; $ nodes = $ currencies -> xpath ( "//currency[@code='{$code}']" ) ; if ( empty ( $ nodes ) ) { throw new \ InvalidArgumentException ( "Unknown currency: {$code}" ) ; } $ cNode = $ nodes [ 0 ] ; $ def = array ( self :: createSymbol ( $ cNode -> symbol , $ code ) , intval ( $ cNode -> exponent ) , self :: createName ( $ cNode ) , ) ; return $ def ; }
Get a currency definition

@param string $code ISO4217 currency code

@return array ['symbol','precision', 'name']
@throws \ErrorException
Get a currency definition