original_string: public function convert(Money $amount, IdentifierInterface $to)
      {
          if (!$toCurrency = $this->getCurrency($to)) {
              throw new \InvalidArgumentException("Currency not supported");
          }
  
          /** @var \Heystack\Ecommerce\Currency\Interfaces\CurrencyInterface $fromCurrency */
          $fromCurrency = $amount->getCurrency();
  
          return $amount->multiply($toCurrency->getValue() / $fromCurrency->getValue());
      }
code: public function convert(Money $amount, IdentifierInterface $to)
      {
          if (!$toCurrency = $this->getCurrency($to)) {
              throw new \InvalidArgumentException("Currency not supported");
          }
  
          /** @var \Heystack\Ecommerce\Currency\Interfaces\CurrencyInterface $fromCurrency */
          $fromCurrency = $amount->getCurrency();
  
          return $amount->multiply($toCurrency->getValue() / $fromCurrency->getValue());
      }
code_tokens: public function convert ( Money $ amount , IdentifierInterface $ to ) { if ( ! $ toCurrency = $ this -> getCurrency ( $ to ) ) { throw new \ InvalidArgumentException ( "Currency not supported" ) ; } /** @var \Heystack\Ecommerce\Currency\Interfaces\CurrencyInterface $fromCurrency */ $ fromCurrency = $ amount -> getCurrency ( ) ; return $ amount -> multiply ( $ toCurrency -> getValue ( ) / $ fromCurrency -> getValue ( ) ) ; }
docstring: Converts amount from one currency to another using the currency's identifier
  
  Warning this method can lose precision!
  
  @param  \SebastianBergmann\Money\Money $amount
  @param  \Heystack\Core\Identifier\IdentifierInterface $to
  @return \SebastianBergmann\Money\Money
  @throws \InvalidArgumentException
docstring_tokens: Converts amount from one currency to another using the currency s identifier