34 lines
774 B
PHP
34 lines
774 B
PHP
<?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);
|
|
|
|
namespace Respect\Validation\Rules;
|
|
|
|
/**
|
|
* Validates a minimum age for a given date.
|
|
*
|
|
* @author Emmerson Siqueira <emmersonsiqueira@gmail.com>
|
|
* @author Henrique Moody <henriquemoody@gmail.com>
|
|
* @author Jean Pimentel <jeanfap@gmail.com>
|
|
* @author Kennedy Tedesco <kennedyt.tw@gmail.com>
|
|
*/
|
|
final class MinAge extends AbstractAge
|
|
{
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected function compare(int $baseDate, int $givenDate): bool
|
|
{
|
|
return $baseDate >= $givenDate;
|
|
}
|
|
}
|