PageRenderTime 52ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/src/Symfony/Component/Validator/Constraints/Max.php

https://github.com/pust/symfony
PHP | 42 lines | 17 code | 6 blank | 19 comment | 0 complexity | 23b3491a82a7f90b7726032840d1c1ee MD5 | raw file
  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. *
  15. * @api
  16. */
  17. class Max extends Constraint
  18. {
  19. public $message = 'This value should be {{ limit }} or less';
  20. public $invalidMessage = 'This value should be a valid number';
  21. public $limit;
  22. /**
  23. * {@inheritDoc}
  24. */
  25. public function getDefaultOption()
  26. {
  27. return 'limit';
  28. }
  29. /**
  30. * {@inheritDoc}
  31. */
  32. public function getRequiredOptions()
  33. {
  34. return array('limit');
  35. }
  36. }