public function getExchangeRates()
    {
        $exchangeRates = [];
        $response = $this
            ->client
            ->get(
                'http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote',
                [
                    'query' => [
                        'format' => 'json',
                    ],
                ]
            )
            ->json();

        foreach ($response['list']['resources'] as $resource) {
            $fields = $resource['resource']['fields'];
            $symbol = str_replace('=X', '', $fields['symbol']);
            $exchangeRates[$symbol] = (float) $fields['price'];
        }

        return $exchangeRates;
    }
public function getExchangeRates()
    {
        $exchangeRates = [];
        $response = $this
            ->client
            ->get(
                'http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote',
                [
                    'query' => [
                        'format' => 'json',
                    ],
                ]
            )
            ->json();

        foreach ($response['list']['resources'] as $resource) {
            $fields = $resource['resource']['fields'];
            $symbol = str_replace('=X', '', $fields['symbol']);
            $exchangeRates[$symbol] = (float) $fields['price'];
        }

        return $exchangeRates;
    }
public function getExchangeRates ( ) { $ exchangeRates = [ ] ; $ response = $ this -> client -> get ( 'http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote' , [ 'query' => [ 'format' => 'json' , ] , ] ) -> json ( ) ; foreach ( $ response [ 'list' ] [ 'resources' ] as $ resource ) { $ fields = $ resource [ 'resource' ] [ 'fields' ] ; $ symbol = str_replace ( '=X' , '' , $ fields [ 'symbol' ] ) ; $ exchangeRates [ $ symbol ] = ( float ) $ fields [ 'price' ] ; } return $ exchangeRates ; }
Get the latest exchange rates.

This method will take in account always that the base currency is USD,
and the result must complain this format.

[
"EUR" => "1,78342784",
"YEN" => "0,67438268",
...
]

@return array exchange rates
Get the latest exchange rates .