respect-validation/library/Rules/Url.php

37 lines
745 B
PHP
Raw Normal View History

2015-01-27 13:25:20 +01:00
<?php
/*
* This file is part of Respect/Validation.
*
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*/
declare(strict_types=1);
2015-06-08 16:47:14 +02:00
namespace Respect\Validation\Rules;
2015-01-27 13:25:20 +01:00
use Respect\Validation\Exceptions\ComponentException;
use const FILTER_VALIDATE_URL;
/**
* Validates whether the input is a URL.
*
* @author Henrique Moody <henriquemoody@gmail.com>
*/
final class Url extends AbstractEnvelope
2015-01-27 13:25:20 +01:00
{
/**
* Initializes the rule.
*
* @throws ComponentException
*/
2015-01-27 13:25:20 +01:00
public function __construct()
{
parent::__construct(new FilterVar(FILTER_VALIDATE_URL));
2015-01-27 13:25:20 +01:00
}
}