Xdigit.php 513 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. use function ctype_xdigit;
  9. /**
  10. * @author Andre Ramaciotti <andre@ramaciotti.com>
  11. * @author Henrique Moody <henriquemoody@gmail.com>
  12. */
  13. final class Xdigit extends AbstractFilterRule
  14. {
  15. /**
  16. * {@inheritDoc}
  17. */
  18. protected function validateFilteredInput(string $input): bool
  19. {
  20. return ctype_xdigit($input);
  21. }
  22. }