src/Services/Directions/DirectionsRoute.php
public function setLegs(array $legs)
    {
        $this->legs = array();

        foreach ($legs as $leg) {
            $this->addLeg($leg);
        }
    }
public function setLegs(array $legs)
    {
        $this->legs = array();

        foreach ($legs as $leg) {
            $this->addLeg($leg);
        }
    }
Sets the route legs

@param array $legs The route legs.