original_string: protected function error( $messageKey, $value = null ) {
          //was a global message set? let's use the global key then
          if( key_exists( self::GLOBAL_MESSAGE_KEY, $this->templates ) )
              $messageKey = self::GLOBAL_MESSAGE_KEY;
          
          //invalide message key
          if( !key_exists( $messageKey, $this->templates ) )
              throw new Exception\MessageTemplateDoesNotExist( "A message template does not exist for key $messageKey" );
  
          $this->messages[ $messageKey ] = $this->buildMessage( $this->templates[$messageKey], $value );
      }
code: protected function error( $messageKey, $value = null ) {
          //was a global message set? let's use the global key then
          if( key_exists( self::GLOBAL_MESSAGE_KEY, $this->templates ) )
              $messageKey = self::GLOBAL_MESSAGE_KEY;
          
          //invalide message key
          if( !key_exists( $messageKey, $this->templates ) )
              throw new Exception\MessageTemplateDoesNotExist( "A message template does not exist for key $messageKey" );
  
          $this->messages[ $messageKey ] = $this->buildMessage( $this->templates[$messageKey], $value );
      }
code_tokens: protected function error ( $ messageKey , $ value = null ) { //was a global message set? let's use the global key then
   if ( key_exists ( self :: GLOBAL_MESSAGE_KEY , $ this -> templates ) ) $ messageKey = self :: GLOBAL_MESSAGE_KEY ; //invalide message key
   if ( ! key_exists ( $ messageKey , $ this -> templates ) ) throw new Exception \ MessageTemplateDoesNotExist ( "A message template does not exist for key $messageKey" ) ; $ this -> messages [ $ messageKey ] = $ this -> buildMessage ( $ this -> templates [ $ messageKey ] , $ value ) ; }
docstring: Adds an error message to the list of errors.
  @param $messageKey The key of the message template.
  @param $value The value that is being validated.
  @throws Exception\MessageTemplateDoesNotExist The message template does not exist.
docstring_tokens: Adds an error message to the list of errors .