[Validator] changed 'self' to 'static' for child class to override pattern constant

This commit is contained in:
hidenorigoto 2011-08-07 15:48:14 +09:00
parent e136718ed6
commit 275da0d478
2 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ class TimeValidator extends ConstraintValidator
$value = (string) $value;
if (!preg_match(self::PATTERN, $value)) {
if (!preg_match(static::PATTERN, $value)) {
$this->setMessage($constraint->message, array('{{ value }}' => $value));
return false;

View File

@ -57,7 +57,7 @@ class UrlValidator extends ConstraintValidator
$value = (string) $value;
$pattern = sprintf(self::PATTERN, implode('|', $constraint->protocols));
$pattern = sprintf(static::PATTERN, implode('|', $constraint->protocols));
if (!preg_match($pattern, $value)) {
$this->setMessage($constraint->message, array('{{ value }}' => $value));