Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Validation / Plugin / Validation / Constraint / RangeConstraint.php
1 <?php
2
3 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
4
5 use Symfony\Component\Validator\Constraints\Range;
6
7 /**
8  * Range constraint.
9  *
10  * Overrides the symfony constraint to use Drupal-style replacement patterns.
11  *
12  * @todo: Move this below the TypedData core component.
13  *
14  * @Constraint(
15  *   id = "Range",
16  *   label = @Translation("Range", context = "Validation"),
17  *   type = { "integer", "float" }
18  * )
19  */
20 class RangeConstraint extends Range {
21
22   public $minMessage = 'This value should be %limit or more.';
23   public $maxMessage = 'This value should be %limit or less.';
24
25   /**
26    * {@inheritdoc}
27    */
28   public function validatedBy() {
29     return '\Symfony\Component\Validator\Constraints\RangeValidator';
30   }
31
32 }