Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ECBConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public function checkFileCache(): void
/**
* Converts foreign currency to euro.
*
* @param int $amount
* @param float $amount
* @param string|array $currency_code
* @param int|null $round
* @return int|array
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also change the function return type (incl. docblock). Same in convert and toForeign please.

* @throws ECBException
*/
public function toEuro(int $amount, $currency_code, ?int $round = null)
public function toEuro(float $amount, $currency_code, ?int $round = null)
{
return $this->convert($amount, $currency_code, function ($amount, $rate) use ($round) {
$val = $amount / $rate;
Expand Down Expand Up @@ -102,7 +102,7 @@ public function list(bool $asArray = false): array
}

/**
* @param int $amount
* @param float $amount
* @param string|array $currency_code
* @param callable $callback
* @return int|array
Expand Down Expand Up @@ -156,7 +156,7 @@ public function reloadExchangeReferences(): void
/**
* Converts euro to foreign currency.
*
* @param int $amount
* @param float $amount
* @param string|array $currency_code
* @param int|null $precision
* @return int|array
Expand Down