protected function buildDirectionsStep(\stdClass $directionsStep)
    {
        $distance = new Distance($directionsStep->distance->text, $directionsStep->distance->value);
        $duration = new Duration($directionsStep->duration->text, $directionsStep->duration->value);
        $endLocation = new Coordinate($directionsStep->end_location->lat, $directionsStep->end_location->lng);
        $instructions = $directionsStep->html_instructions;
        $encodedPolyline = new EncodedPolyline($directionsStep->polyline->points);
        $startLocation = new Coordinate($directionsStep->start_location->lat, $directionsStep->start_location->lng);
        $travelMode = $directionsStep->travel_mode;

        return new DirectionsStep(
            $distance,
            $duration,
            $endLocation,
            $instructions,
            $encodedPolyline,
            $startLocation,
            $travelMode
        );
    }
protected function buildDirectionsStep(\stdClass $directionsStep)
    {
        $distance = new Distance($directionsStep->distance->text, $directionsStep->distance->value);
        $duration = new Duration($directionsStep->duration->text, $directionsStep->duration->value);
        $endLocation = new Coordinate($directionsStep->end_location->lat, $directionsStep->end_location->lng);
        $instructions = $directionsStep->html_instructions;
        $encodedPolyline = new EncodedPolyline($directionsStep->polyline->points);
        $startLocation = new Coordinate($directionsStep->start_location->lat, $directionsStep->start_location->lng);
        $travelMode = $directionsStep->travel_mode;

        return new DirectionsStep(
            $distance,
            $duration,
            $endLocation,
            $instructions,
            $encodedPolyline,
            $startLocation,
            $travelMode
        );
    }
protected function buildDirectionsStep ( \ stdClass $ directionsStep ) { $ distance = new Distance ( $ directionsStep -> distance -> text , $ directionsStep -> distance -> value ) ; $ duration = new Duration ( $ directionsStep -> duration -> text , $ directionsStep -> duration -> value ) ; $ endLocation = new Coordinate ( $ directionsStep -> end_location -> lat , $ directionsStep -> end_location -> lng ) ; $ instructions = $ directionsStep -> html_instructions ; $ encodedPolyline = new EncodedPolyline ( $ directionsStep -> polyline -> points ) ; $ startLocation = new Coordinate ( $ directionsStep -> start_location -> lat , $ directionsStep -> start_location -> lng ) ; $ travelMode = $ directionsStep -> travel_mode ; return new DirectionsStep ( $ distance , $ duration , $ endLocation , $ instructions , $ encodedPolyline , $ startLocation , $ travelMode ) ; }
Builds the directions step according to the normalized directions API step.

@param \stdClass $directionsStep The normalized directions step.

@return \Ivory\GoogleMap\Services\Directions\DirectionsStep The builded directions step.
Builds the directions step according to the normalized directions API step .