mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Birthdate validator: remove unused comparison
This commit is contained in:
parent
364a67b83a
commit
876ebca210
@ -31,8 +31,8 @@ class BirthdateValidator extends ConstraintValidator
|
|||||||
private string $below_interval = 'P150Y';
|
private string $below_interval = 'P150Y';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ParameterBagInterface $parameterBag,
|
private readonly ParameterBagInterface $parameterBag,
|
||||||
private ClockInterface $clock
|
private readonly ClockInterface $clock
|
||||||
) {
|
) {
|
||||||
$this->interval_spec = $this->parameterBag->get('chill_person')['validation']['birthdate_not_after'];
|
$this->interval_spec = $this->parameterBag->get('chill_person')['validation']['birthdate_not_after'];
|
||||||
}
|
}
|
||||||
@ -71,13 +71,9 @@ class BirthdateValidator extends ConstraintValidator
|
|||||||
|
|
||||||
private function getLimitDate(): DateTime
|
private function getLimitDate(): DateTime
|
||||||
{
|
{
|
||||||
if (null !== $this->interval_spec) {
|
$interval = new DateInterval($this->interval_spec);
|
||||||
$interval = new DateInterval($this->interval_spec);
|
|
||||||
|
|
||||||
return DateTime::createFromImmutable($this->clock->now()->sub($interval));
|
return DateTime::createFromImmutable($this->clock->now()->sub($interval));
|
||||||
}
|
|
||||||
|
|
||||||
return DateTime::createFromImmutable($this->clock->now());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getBelowLimitDate(): DateTime
|
private function getBelowLimitDate(): DateTime
|
||||||
|
Loading…
x
Reference in New Issue
Block a user