Skip to content

Commit

Permalink
update: logic for same currency
Browse files Browse the repository at this point in the history
  • Loading branch information
OxCom committed Jun 16, 2018
1 parent a1bd9f3 commit 5ef52dc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Model/Currency/Import/Ecb.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ protected function _convert($currencyFrom, $currencyTo)
// @codingStandardsIgnoreStop
$this->doRequestDelay();

// there should not be any calls
if ($currencyFrom === $currencyTo) {
return 1;
}

$rate = null;
$url = static::SOURCE_LINK;

Expand Down
5 changes: 5 additions & 0 deletions Model/Currency/Import/Fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ protected function _convert($currencyFrom, $currencyTo)
// @codingStandardsIgnoreStop
$this->doRequestDelay();

// there should not be any calls
if ($currencyFrom === $currencyTo) {
return 1;
}

$rate = null;
$url = strtr(static::SOURCE_LINK, [
'{{TOKEN}}' => $this->getAccessToken(),
Expand Down
5 changes: 5 additions & 0 deletions Model/Currency/Import/Google.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ protected function _convert($currencyFrom, $currencyTo)
// @codingStandardsIgnoreStop
$this->doRequestDelay();

// there should not be any calls
if ($currencyFrom === $currencyTo) {
return 1;
}

$zero = rand(1, 5);
$value = pow(10, $zero);

Expand Down

0 comments on commit 5ef52dc

Please sign in to comment.