Printable.php 735 B

1234567891011121314151617181920212223242526272829303132
  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_print;
  9. /**
  10. * Validates whether an input is printable character(s).
  11. *
  12. * @author Alexandre Gomes Gaigalas <alganet@gmail.com>
  13. * @author Andre Ramaciotti <andre@ramaciotti.com>
  14. * @author Emmerson Siqueira <emmersonsiqueira@gmail.com>
  15. * @author Henrique Moody <henriquemoody@gmail.com>
  16. * @author Nick Lombard <github@jigsoft.co.za>
  17. */
  18. final class Printable extends AbstractFilterRule
  19. {
  20. /**
  21. * {@inheritDoc}
  22. */
  23. protected function validateFilteredInput(string $input): bool
  24. {
  25. return ctype_print($input);
  26. }
  27. }