original_string: public function setTargetUrl($url)
      {
          if (empty($url)) {
              throw new \InvalidArgumentException('Cannot redirect to an empty URL.');
          }
  
          $this->targetUrl = $url;
  
          $this->setContent(
              sprintf('<!DOCTYPE html>
  <html>
      <head>
          <meta charset="UTF-8" />
          <meta http-equiv="refresh" content="0;url=%1$s" />
  
          <title>Redirecting to %1$s</title>
      </head>
      <body>
          Redirecting to <a href="%1$s">%1$s</a>.
      </body>
  </html>', htmlspecialchars($url, ENT_QUOTES, 'UTF-8')));
  
          $this->headers->set('Location', $url);
  
          return $this;
      }
code: public function setTargetUrl($url)
      {
          if (empty($url)) {
              throw new \InvalidArgumentException('Cannot redirect to an empty URL.');
          }
  
          $this->targetUrl = $url;
  
          $this->setContent(
              sprintf('<!DOCTYPE html>
  <html>
      <head>
          <meta charset="UTF-8" />
          <meta http-equiv="refresh" content="0;url=%1$s" />
  
          <title>Redirecting to %1$s</title>
      </head>
      <body>
          Redirecting to <a href="%1$s">%1$s</a>.
      </body>
  </html>', htmlspecialchars($url, ENT_QUOTES, 'UTF-8')));
  
          $this->headers->set('Location', $url);
  
          return $this;
      }
code_tokens: public function setTargetUrl ( $ url ) { if ( empty ( $ url ) ) { throw new \ InvalidArgumentException ( 'Cannot redirect to an empty URL.' ) ; } $ this -> targetUrl = $ url ; $ this -> setContent ( sprintf ( '<!DOCTYPE html>
  <html>
      <head>
          <meta charset="UTF-8" />
          <meta http-equiv="refresh" content="0;url=%1$s" />
  
          <title>Redirecting to %1$s</title>
      </head>
      <body>
          Redirecting to <a href="%1$s">%1$s</a>.
      </body>
  </html>' , htmlspecialchars ( $ url , ENT_QUOTES , 'UTF-8' ) ) ) ; $ this -> headers -> set ( 'Location' , $ url ) ; return $ this ; }
docstring: Sets the redirect target of this response.
  
  @param string $url The URL to redirect to
  
  @return $this
  
  @throws \InvalidArgumentException
docstring_tokens: Sets the redirect target of this response .