original_string: public function attach(ValidatorInterface $validator,
                             $showMessages = true,
                             $leadingTemplate = null,
                             $trailingTemplate = null,
                             $priority = self::DEFAULT_PRIORITY)
      {
          $this->validators->insert(
              array(
                  'instance' => $validator,
                  'show_messages' => (bool)$showMessages,
                  'leading_message_template' => $leadingTemplate,
                  'trailing_message_template' => $trailingTemplate,
              ),
              $priority
          );
          return $this;
      }
code: public function attach(ValidatorInterface $validator,
                             $showMessages = true,
                             $leadingTemplate = null,
                             $trailingTemplate = null,
                             $priority = self::DEFAULT_PRIORITY)
      {
          $this->validators->insert(
              array(
                  'instance' => $validator,
                  'show_messages' => (bool)$showMessages,
                  'leading_message_template' => $leadingTemplate,
                  'trailing_message_template' => $trailingTemplate,
              ),
              $priority
          );
          return $this;
      }
code_tokens: public function attach ( ValidatorInterface $ validator , $ showMessages = true , $ leadingTemplate = null , $ trailingTemplate = null , $ priority = self :: DEFAULT_PRIORITY ) { $ this -> validators -> insert ( array ( 'instance' => $ validator , 'show_messages' => ( bool ) $ showMessages , 'leading_message_template' => $ leadingTemplate , 'trailing_message_template' => $ trailingTemplate , ) , $ priority ) ; return $ this ; }
docstring: Attaches validator to end of chain.
  
  @param ValidatorInterface $validator
  @param boolean            $showMessages     Show messages for this
  validator on failure.
  @param string|null        $leadingTemplate  Validator's leading message
  template.
  @param string|null        $trailingTemplate Validator's trailing message
  template.
  @param int                $priority         Validator's priority.
  @throws Exception\InvalidArgumentException
  @return self
docstring_tokens: Attaches validator to end of chain .