protected function getConversionRate($unit)
    {
        if (!isset(static::$conversionMap[$unit])) {
            throw new \Exception(sprintf(
                'Conversion rate between "%s" and "%s" is not defined.',
                static::$native,
                $unit
            ));
        }
        return static::$conversionMap[$unit];
    }
protected function getConversionRate($unit)
    {
        if (!isset(static::$conversionMap[$unit])) {
            throw new \Exception(sprintf(
                'Conversion rate between "%s" and "%s" is not defined.',
                static::$native,
                $unit
            ));
        }
        return static::$conversionMap[$unit];
    }
protected function getConversionRate ( $ unit ) { if ( ! isset ( static :: $ conversionMap [ $ unit ] ) ) { throw new \ Exception ( sprintf ( 'Conversion rate between "%s" and "%s" is not defined.' , static :: $ native , $ unit ) ) ; } return static :: $ conversionMap [ $ unit ] ; }
Returns the conversion rate for a unit.
@param string $unit unit name
@return mixed conversion rate
@throws \Exception if the conversion rate is not defined.
Returns the conversion rate for a unit .