protected function prepareUrl($url)
    {
        if (empty($url)) {
            throw new \RuntimeException(sprintf('Empty URL at item with id: "%s"', $this->getId()));
        }

        if (stripos($url, '://') !== false) {
            throw new \RuntimeException(sprintf('Malformed relative URL at item with id: "%s"', $this->getId()));
        }

        if (stripos($url, '/') !== 0) {
            throw new \RuntimeException(sprintf('Relative URL must start with "/" at item with id: "%s"', $this->getId()));
        }

        return $url;
    }
protected function prepareUrl($url)
    {
        if (empty($url)) {
            throw new \RuntimeException(sprintf('Empty URL at item with id: "%s"', $this->getId()));
        }

        if (stripos($url, '://') !== false) {
            throw new \RuntimeException(sprintf('Malformed relative URL at item with id: "%s"', $this->getId()));
        }

        if (stripos($url, '/') !== 0) {
            throw new \RuntimeException(sprintf('Relative URL must start with "/" at item with id: "%s"', $this->getId()));
        }

        return $url;
    }
protected function prepareUrl ( $ url ) { if ( empty ( $ url ) ) { throw new \ RuntimeException ( sprintf ( 'Empty URL at item with id: "%s"' , $ this -> getId ( ) ) ) ; } if ( stripos ( $ url , '://' ) !== false ) { throw new \ RuntimeException ( sprintf ( 'Malformed relative URL at item with id: "%s"' , $ this -> getId ( ) ) ) ; } if ( stripos ( $ url , '/' ) !== 0 ) { throw new \ RuntimeException ( sprintf ( 'Relative URL must start with "/" at item with id: "%s"' , $ this -> getId ( ) ) ) ; } return $ url ; }
Prepare a URL.

@param string $url The relative URL

@return string

@throws \RuntimeException If empty or malformed relative URL
Prepare a URL .