public function setUrl($url): self
    {
        if (\is_string($url)) {
            $this->options['url'] = $url;

            return $this;
        }

        if ($url instanceof Leg) {
            $this->setUrlFromLeg($url);

            return $this;
        }

        if ($url instanceof BoardData) {
            $this->setUrlFromBoardData($url);

            return $this;
        }

        throw new \InvalidArgumentException(
            sprintf('setUrl must be a string, Leg or BoardData object')
        );
    }
public function setUrl($url): self
    {
        if (\is_string($url)) {
            $this->options['url'] = $url;

            return $this;
        }

        if ($url instanceof Leg) {
            $this->setUrlFromLeg($url);

            return $this;
        }

        if ($url instanceof BoardData) {
            $this->setUrlFromBoardData($url);

            return $this;
        }

        throw new \InvalidArgumentException(
            sprintf('setUrl must be a string, Leg or BoardData object')
        );
    }
public function setUrl ( $ url ) : self { if ( \ is_string ( $ url ) ) { $ this -> options [ 'url' ] = $ url ; return $ this ; } if ( $ url instanceof Leg ) { $ this -> setUrlFromLeg ( $ url ) ; return $ this ; } if ( $ url instanceof BoardData ) { $ this -> setUrlFromBoardData ( $ url ) ; return $ this ; } throw new \ InvalidArgumentException ( sprintf ( 'setUrl must be a string, Leg or BoardData object' ) ) ; }
Set journey details from a URL.

@param string|Leg|BoardData $url

@return $this
Set journey details from a URL .