3 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
5 use Symfony\Component\Validator\Constraints\Length;
10 * Overrides the symfony constraint to use Drupal-style replacement patterns.
12 * @todo: Move this below the TypedData core component.
16 * label = @Translation("Length", context = "Validation"),
20 class LengthConstraint extends Length {
22 public $maxMessage = 'This value is too long. It should have %limit character or less.|This value is too long. It should have %limit characters or less.';
23 public $minMessage = 'This value is too short. It should have %limit character or more.|This value is too short. It should have %limit characters or more.';
24 public $exactMessage = 'This value should have exactly %limit character.|This value should have exactly %limit characters.';
29 public function validatedBy() {
30 return '\Symfony\Component\Validator\Constraints\LengthValidator';