respect-validation/library/Respect/Validation/Exceptions/RegexException.php
2010-10-18 06:18:46 -02:00

24 lines
No EOL
566 B
PHP

<?php
namespace Respect\Validation\Exceptions;
use Exception;
class RegexException extends InvalidException
{
const MSG_REGEX = 'Regex_1';
protected $messageTemplates = array(
self::MSG_REGEX => '%s does not validate against the provided regular expression: %s.'
);
public function __construct($input, $regex)
{
parent::__construct(
sprintf(
$this->getMessageTemplate(self::MSG_REGEX),
$this->getStringRepresentation($input), $regex
)
);
}
}