src/RunOpenCode/ExchangeRate/Repository/FileRepository.php
protected function fromJson($json)
    {
        $data = json_decode($json, true);

        return new Rate(
            $data['sourceName'],
            (float) $data['value'],
            $data['currencyCode'],
            $data['rateType'],
            \DateTime::createFromFormat(\DateTime::ATOM, $data['date']),
            $data['baseCurrencyCode'],
            \DateTime::createFromFormat(\DateTime::ATOM, $data['createdAt']),
            \DateTime::createFromFormat(\DateTime::ATOM, $data['modifiedAt'])
        );
    }
protected function fromJson($json)
    {
        $data = json_decode($json, true);

        return new Rate(
            $data['sourceName'],
            (float) $data['value'],
            $data['currencyCode'],
            $data['rateType'],
            \DateTime::createFromFormat(\DateTime::ATOM, $data['date']),
            $data['baseCurrencyCode'],
            \DateTime::createFromFormat(\DateTime::ATOM, $data['createdAt']),
            \DateTime::createFromFormat(\DateTime::ATOM, $data['modifiedAt'])
        );
    }
Deserialize JSON string to Rate

@param string $json Serialized rate.
@return Rate Deserialized rate.