Ignore:
Timestamp:
May 31, 2021 1:51:18 AM (3 years ago)
Author:
anonymous
Message:

Add brackets to avoid ambiguity in return value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Currency.inc.php

    r550 r746  
    123123    public function getValue($amount, $base, $target)
    124124    {
    125         if (false !== $rate = $this->getRate($base, $target)) {
     125        if (false !== ($rate = $this->getRate($base, $target))) {
    126126            return abs($rate * $amount);
    127127        } else {
     
    231231            // Fetch XML from ECB <http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml>
    232232            $api_url = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml';
    233             if (false === $sXML = file_get_contents($api_url)) {
     233            if (false === ($sXML = file_get_contents($api_url))) {
    234234                $app->logMsg(sprintf('Failed to load ECB XML data from: %s', $api_url), LOG_WARNING, __FILE__, __LINE__);
    235235                return false;
    236236            }
    237             if (false === $oXML = simplexml_load_string($sXML)) {
     237            if (false === ($oXML = simplexml_load_string($sXML))) {
    238238                $app->logMsg(sprintf('Failed to decode ECB XML data: %s', truncate($sXML, 200, 'end')), LOG_WARNING, __FILE__, __LINE__);
    239239                return false;
Note: See TracChangeset for help on using the changeset viewer.