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;
    }