Url.php 605 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 Respect\Validation\Exceptions\ComponentException;
  9. use const FILTER_VALIDATE_URL;
  10. /**
  11. * Validates whether the input is a URL.
  12. *
  13. * @author Henrique Moody <henriquemoody@gmail.com>
  14. */
  15. final class Url extends AbstractEnvelope
  16. {
  17. /**
  18. * Initializes the rule.
  19. *
  20. * @throws ComponentException
  21. */
  22. public function __construct()
  23. {
  24. parent::__construct(new FilterVar(FILTER_VALIDATE_URL));
  25. }
  26. }