@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public static function roundValue($calc, $short) |
| 40 | 40 | { |
| 41 | - if($short){ $number = 2; }else{ $number = 5; } |
|
| 41 | + if($short){ $number = 2; } else{ $number = 5; } |
|
| 42 | 42 | $output = round($calc, $number); |
| 43 | 43 | |
| 44 | 44 | return $output; |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | $file = CacheFile::getFileName(); |
| 63 | 63 | if(CacheFile::isCurrent($file)){ |
| 64 | 64 | $data = CacheFile::getCache($file); |
| 65 | - }else{ |
|
| 65 | + } else{ |
|
| 66 | 66 | $data = file_get_contents(self::API_URL."?access_key=".$this->api_key); |
| 67 | 67 | CacheFile::setNewCacheFile($file, $data, $cacheTime); |
| 68 | 68 | } |
| 69 | - }else{ |
|
| 69 | + } else{ |
|
| 70 | 70 | $data = file_get_contents(self::API_URL."?access_key=".$this->api_key); |
| 71 | 71 | CacheFile::setNewCacheFile(false, $data, $cacheTime); |
| 72 | 72 | } |
| 73 | - }else{ |
|
| 73 | + } else{ |
|
| 74 | 74 | $data = file_get_contents(self::API_URL."?access_key=".$this->api_key); |
| 75 | 75 | } |
| 76 | 76 | $data = json_decode($data); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | array_push($newArray, array($currency, array($currency2 => $calc))); |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | - }else{ |
|
| 92 | + } else{ |
|
| 93 | 93 | foreach($getFrom as $currency){ |
| 94 | 94 | $getA = $data->rates->$currency; |
| 95 | 95 | $getB = $data->rates->$getTo; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | array_push($newArray, array($currency, array($getTo => $calc))); |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | - }else{ |
|
| 100 | + } else{ |
|
| 101 | 101 | foreach($getTo as $currency){ |
| 102 | 102 | $getA = $data->rates->$getFrom; |
| 103 | 103 | $getB = $data->rates->$currency; |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | $output = $newArray; |
| 109 | - }else{ |
|
| 109 | + } else{ |
|
| 110 | 110 | $getA = $data->rates->$getFrom; |
| 111 | 111 | $getB = $data->rates->$getTo; |
| 112 | 112 | |
| 113 | 113 | $output = Calculate::roundValue(($amount * $getB)/$getA, $short); |
| 114 | 114 | } |
| 115 | - }else{ |
|
| 115 | + } else{ |
|
| 116 | 116 | $output = false; |
| 117 | 117 | } |
| 118 | 118 | |