src/TimeInTransit.php
private function formatResponse(SimpleXMLElement $response)
    {
        // We don't need to return data regarding the response to the user
        unset($response->Response);

        $result = $this->convertXmlObject($response);

        // Fix for when one ServiceSummary while expecting an array in later responses - easiest place to fix here
        if (isset($result->TransitResponse->ServiceSummary->Service)) {
            $result->TransitResponse->ServiceSummary = array($result->TransitResponse->ServiceSummary);
        }

        return new TimeInTransitResponse($result->TransitResponse);
    }
private function formatResponse(SimpleXMLElement $response)
    {
        // We don't need to return data regarding the response to the user
        unset($response->Response);

        $result = $this->convertXmlObject($response);

        // Fix for when one ServiceSummary while expecting an array in later responses - easiest place to fix here
        if (isset($result->TransitResponse->ServiceSummary->Service)) {
            $result->TransitResponse->ServiceSummary = array($result->TransitResponse->ServiceSummary);
        }

        return new TimeInTransitResponse($result->TransitResponse);
    }
Format the response.

@param SimpleXMLElement $response

@return TimeInTransitResponse