original_string: protected function createMessageFromTemplate($messageTemplate, $value)
      {
          // AbstractValidator::translateMessage does not use first argument.
          $message = $this->translateMessage('dummyValue',
                                             (string) $messageTemplate);
      
          if (is_object($value) &&
                          !in_array('__toString', get_class_methods($value))
          ) {
              $value = get_class($value) . ' object';
          } elseif (is_array($value)) {
              $value = var_export($value, 1);
          } else {
              $value = (string) $value;
          }
      
          if ($this->isValueObscured()) {
              $value = str_repeat('*', strlen($value));
          }
      
          $message = str_replace('%value%', (string) $value, $message);
          $message = str_replace('%count%', (string) $this->count(), $message);
      
          $length = self::getMessageLength();
          if (($length > -1) && (strlen($message) > $length)) {
              $message = substr($message, 0, ($length - 3)) . '...';
          }
      
          return $message;
      }
code: protected function createMessageFromTemplate($messageTemplate, $value)
      {
          // AbstractValidator::translateMessage does not use first argument.
          $message = $this->translateMessage('dummyValue',
                                             (string) $messageTemplate);
      
          if (is_object($value) &&
                          !in_array('__toString', get_class_methods($value))
          ) {
              $value = get_class($value) . ' object';
          } elseif (is_array($value)) {
              $value = var_export($value, 1);
          } else {
              $value = (string) $value;
          }
      
          if ($this->isValueObscured()) {
              $value = str_repeat('*', strlen($value));
          }
      
          $message = str_replace('%value%', (string) $value, $message);
          $message = str_replace('%count%', (string) $this->count(), $message);
      
          $length = self::getMessageLength();
          if (($length > -1) && (strlen($message) > $length)) {
              $message = substr($message, 0, ($length - 3)) . '...';
          }
      
          return $message;
      }
code_tokens: protected function createMessageFromTemplate ( $ messageTemplate , $ value ) { // AbstractValidator::translateMessage does not use first argument. $ message = $ this -> translateMessage ( 'dummyValue' , ( string ) $ messageTemplate ) ; if ( is_object ( $ value ) && ! in_array ( '__toString' , get_class_methods ( $ value ) ) ) { $ value = get_class ( $ value ) . ' object' ; } elseif ( is_array ( $ value ) ) { $ value = var_export ( $ value , 1 ) ; } else { $ value = ( string ) $ value ; } if ( $ this -> isValueObscured ( ) ) { $ value = str_repeat ( '*' , strlen ( $ value ) ) ; } $ message = str_replace ( '%value%' , ( string ) $ value , $ message ) ; $ message = str_replace ( '%count%' , ( string ) $ this -> count ( ) , $ message ) ; $ length = self :: getMessageLength ( ) ; if ( ( $ length > - 1 ) && ( strlen ( $ message ) > $ length ) ) { $ message = substr ( $ message , 0 , ( $ length - 3 ) ) . '...' ; } return $ message ; }
docstring: Constructs and returns validation failure message for specified message
  template and value.
  
  This is used in place of AbstractValidator::createMessage() since leading
  and trailing union messages are not stored with a message key under
  abstractOptions['messageTemplates'].
  
  If a translator is available and a translation exists for $messageKey,
  the translation will be used.
  
  @param  string              $messageTemplate
  @param  string|array|object $value
  @return string
docstring_tokens: Constructs and returns validation failure message for specified message template and value .