original_string: public function handleResponse($response)
      {
          switch (true) {
              // Render default template and use $response as template variables
              case is_array($response) :
                  $content = $this->view->render($this->getDefaultTemplate(), $response);
  
                  return $this->response->setContent($content);
  
              // Response directly
              case is_scalar($response) || is_null($response) :
                  return $this->response->setContent($response);
  
              // Response if not sent
              case $response instanceof Response :
                  return $response;
  
              default :
                  throw new \InvalidArgumentException(sprintf(
                      'Expected argument of type array, printable variable or \Wei\Response, "%s" given',
                      is_object($response) ? get_class($response) : gettype($response)
                  ));
          }
      }
code: public function handleResponse($response)
      {
          switch (true) {
              // Render default template and use $response as template variables
              case is_array($response) :
                  $content = $this->view->render($this->getDefaultTemplate(), $response);
  
                  return $this->response->setContent($content);
  
              // Response directly
              case is_scalar($response) || is_null($response) :
                  return $this->response->setContent($response);
  
              // Response if not sent
              case $response instanceof Response :
                  return $response;
  
              default :
                  throw new \InvalidArgumentException(sprintf(
                      'Expected argument of type array, printable variable or \Wei\Response, "%s" given',
                      is_object($response) ? get_class($response) : gettype($response)
                  ));
          }
      }
code_tokens: public function handleResponse ( $ response ) { switch ( true ) { // Render default template and use $response as template variables case is_array ( $ response ) : $ content = $ this -> view -> render ( $ this -> getDefaultTemplate ( ) , $ response ) ; return $ this -> response -> setContent ( $ content ) ; // Response directly case is_scalar ( $ response ) || is_null ( $ response ) : return $ this -> response -> setContent ( $ response ) ; // Response if not sent case $ response instanceof Response : return $ response ; default : throw new \ InvalidArgumentException ( sprintf ( 'Expected argument of type array, printable variable or \Wei\Response, "%s" given' , is_object ( $ response ) ? get_class ( $ response ) : gettype ( $ response ) ) ) ; } }
docstring: Handle the response variable returned by controller action
  
  @param  mixed $response
  @return Response
  @throws \InvalidArgumentException
docstring_tokens: Handle the response variable returned by controller action