private function processHistoricalResponse(Response $response) { if ($response->isOK()) { $data = json_decode($response->getContent(true), true); $values = array_map(array($this, 'float'), $data['val']); array_pop($values); // remove the last null value... return new History(new DateTime($data['tm']), $values, $data['un'], (int) $data['dt']); } }