original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Prepare a URL.
  
  @param string $url The relative URL
  
  @return string
  
  @throws \RuntimeException If empty or malformed relative URL
docstring_tokens: Prepare a URL .