Max.php 536 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /*
  3. * Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
  4. * SPDX-License-Identifier: MIT
  5. */
  6. declare(strict_types=1);
  7. namespace Respect\Validation\Rules;
  8. /**
  9. * Validates whether the input is less than or equal to a value.
  10. *
  11. * @author Alexandre Gomes Gaigalas <alganet@gmail.com>
  12. * @author Henrique Moody <henriquemoody@gmail.com>
  13. */
  14. final class Max extends AbstractComparison
  15. {
  16. /**
  17. * {@inheritDoc}
  18. */
  19. protected function compare($left, $right): bool
  20. {
  21. return $left <= $right;
  22. }
  23. }