mirror of
https://github.com/Respect/Validation.git
synced 2026-03-17 23:59:51 +01:00
24 lines
No EOL
566 B
PHP
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
|
|
)
|
|
);
|
|
}
|
|
|
|
} |