original_string: protected function createMessage($message, $variables = null)
      {
          if (null !== $variables && is_array($variables)) {
              $variables = array_merge($this->getMessageVariables(), $variables);
          } else {
              $variables = $this->getMessageVariables();
          }
  
          foreach ($variables as $variableKey => $variable) {
              if (is_array($variable) || ($variable instanceof Traversable)) {
                  $variable = implode(', ', array_values($variable));
              }
  
              if (!is_scalar($variable)) {
                  $variable = $this->switchType($variable);
              }
  
              $message = str_replace("%$variableKey%", (string) $variable, $message);
          }
  
          return $message;
      }
code: protected function createMessage($message, $variables = null)
      {
          if (null !== $variables && is_array($variables)) {
              $variables = array_merge($this->getMessageVariables(), $variables);
          } else {
              $variables = $this->getMessageVariables();
          }
  
          foreach ($variables as $variableKey => $variable) {
              if (is_array($variable) || ($variable instanceof Traversable)) {
                  $variable = implode(', ', array_values($variable));
              }
  
              if (!is_scalar($variable)) {
                  $variable = $this->switchType($variable);
              }
  
              $message = str_replace("%$variableKey%", (string) $variable, $message);
          }
  
          return $message;
      }
code_tokens: protected function createMessage ( $ message , $ variables = null ) { if ( null !== $ variables && is_array ( $ variables ) ) { $ variables = array_merge ( $ this -> getMessageVariables ( ) , $ variables ) ; } else { $ variables = $ this -> getMessageVariables ( ) ; } foreach ( $ variables as $ variableKey => $ variable ) { if ( is_array ( $ variable ) || ( $ variable instanceof Traversable ) ) { $ variable = implode ( ', ' , array_values ( $ variable ) ) ; } if ( ! is_scalar ( $ variable ) ) { $ variable = $ this -> switchType ( $ variable ) ; } $ message = str_replace ( "%$variableKey%" , ( string ) $ variable , $ message ) ; } return $ message ; }
docstring: Constructs and returns a exception message with the given message key and value.
  Returns null if and only if the given key does not correspond to an existing template.
  
  @param string $message
  @param array  $variables
  
  @return string
docstring_tokens: Constructs and returns a exception message with the given message key and value . Returns null if and only if the given key does not correspond to an existing template .