vendor/symfony/validator/Constraints/Type.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\Validator\Constraints;
  11. use Symfony\Component\Validator\Constraint;
  12. /**
  13.  * @Annotation
  14.  * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
  15.  *
  16.  * @author Bernhard Schussek <bschussek@gmail.com>
  17.  */
  18. class Type extends Constraint
  19. {
  20.     public const INVALID_TYPE_ERROR 'ba785a8c-82cb-4283-967c-3cf342181b40';
  21.     protected static $errorNames = [
  22.         self::INVALID_TYPE_ERROR => 'INVALID_TYPE_ERROR',
  23.     ];
  24.     public $message 'This value should be of type {{ type }}.';
  25.     public $type;
  26.     /**
  27.      * {@inheritdoc}
  28.      */
  29.     public function getDefaultOption()
  30.     {
  31.         return 'type';
  32.     }
  33.     /**
  34.      * {@inheritdoc}
  35.      */
  36.     public function getRequiredOptions()
  37.     {
  38.         return ['type'];
  39.     }
  40. }