MinAge.php 634 B

1234567891011121314151617181920212223242526272829
  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 a minimum age for a given date.
  10. *
  11. * @author Emmerson Siqueira <emmersonsiqueira@gmail.com>
  12. * @author Henrique Moody <henriquemoody@gmail.com>
  13. * @author Jean Pimentel <jeanfap@gmail.com>
  14. * @author Kennedy Tedesco <kennedyt.tw@gmail.com>
  15. */
  16. final class MinAge extends AbstractAge
  17. {
  18. /**
  19. * {@inheritDoc}
  20. */
  21. protected function compare(int $baseDate, int $givenDate): bool
  22. {
  23. return $baseDate >= $givenDate;
  24. }
  25. }