Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Validation / Plugin / Validation / Constraint / CountConstraint.php
1 <?php
2
3 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
4
5 use Symfony\Component\Validator\Constraints\Count;
6
7 /**
8  * Count constraint.
9  *
10  * Overrides the symfony constraint to use Drupal-style replacement patterns.
11  *
12  * @Constraint(
13  *   id = "Count",
14  *   label = @Translation("Count", context = "Validation"),
15  *   type = { "list" }
16  * )
17  */
18 class CountConstraint extends Count {
19
20   public $minMessage = 'This collection should contain %limit element or more.|This collection should contain %limit elements or more.';
21   public $maxMessage = 'This collection should contain %limit element or less.|This collection should contain %limit elements or less.';
22   public $exactMessage = 'This collection should contain exactly %limit element.|This collection should contain exactly %limit elements.';
23
24   /**
25    * {@inheritdoc}
26    */
27   public function validatedBy() {
28     return '\Symfony\Component\Validator\Constraints\CountValidator';
29   }
30
31 }