original_string: public function setMessage($message, $type = 'info', $key = 'messages')
      {
          if ($message !== '') {
  
              $messages = (array) $this->get("$key.$type", array());
  
              if (!in_array($message, $messages)) {
                  $messages[] = $message;
                  $this->set("$key.$type", $messages);
              }
          }
      }
code: public function setMessage($message, $type = 'info', $key = 'messages')
      {
          if ($message !== '') {
  
              $messages = (array) $this->get("$key.$type", array());
  
              if (!in_array($message, $messages)) {
                  $messages[] = $message;
                  $this->set("$key.$type", $messages);
              }
          }
      }
code_tokens: public function setMessage ( $ message , $ type = 'info' , $ key = 'messages' ) { if ( $ message !== '' ) { $ messages = ( array ) $ this -> get ( "$key.$type" , array ( ) ) ; if ( ! in_array ( $ message , $ messages ) ) { $ messages [ ] = $ message ; $ this -> set ( "$key.$type" , $ messages ) ; } } }
docstring: Sets a message to be displayed to the user
  @param string $message
  @param string $type
  @param string $key
docstring_tokens: Sets a message to be displayed to the user