mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 19:34:31 +02:00
Fixed code style.
This commit is contained in:
parent
2853e471c4
commit
d0b1024d80
212 changed files with 495 additions and 1005 deletions
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
|
||||
use App\Entity\PriceInformations\Currency;
|
||||
use Brick\Math\BigDecimal;
|
||||
use Swap\Swap;
|
||||
|
@ -21,14 +19,12 @@ class ExchangeRateUpdater
|
|||
|
||||
/**
|
||||
* Updates the exchange rate of the given currency using the globally configured providers.
|
||||
* @param Currency $currency
|
||||
* @return Currency
|
||||
*/
|
||||
public function update(Currency $currency): Currency
|
||||
{
|
||||
$rate = $this->swap->latest($currency->getIsoCode().'/'.$this->base_currency);
|
||||
$currency->setExchangeRate(BigDecimal::of($rate->getValue()));
|
||||
|
||||
return $currency;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue