[Validator] changed 'self' to 'static' for child class to override pattern constant
This commit is contained in:
parent
e136718ed6
commit
275da0d478
@ -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;
|
||||
|
@ -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));
|
||||
|
Reference in New Issue
Block a user