mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 12:33:49 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -23,11 +23,8 @@ use function is_object;
|
||||
|
||||
class BirthdateValidator extends ConstraintValidator
|
||||
{
|
||||
private $interval_spec;
|
||||
|
||||
public function __construct($interval_spec = null)
|
||||
public function __construct(private $interval_spec = null)
|
||||
{
|
||||
$this->interval_spec = $interval_spec;
|
||||
}
|
||||
|
||||
public function validate($value, Constraint $constraint)
|
||||
@@ -38,7 +35,7 @@ class BirthdateValidator extends ConstraintValidator
|
||||
|
||||
if (!$value instanceof DateTime) {
|
||||
throw new LogicException('The input should a be a \DateTime interface,'
|
||||
. (is_object($value) ? get_class($value) : gettype($value)));
|
||||
. (get_debug_type($value)));
|
||||
}
|
||||
|
||||
$limitDate = $this->getLimitDate();
|
||||
|
@@ -22,12 +22,9 @@ class PersonHasCenterValidator extends ConstraintValidator
|
||||
{
|
||||
private bool $centerRequired;
|
||||
|
||||
private CenterResolverManagerInterface $centerResolverManager;
|
||||
|
||||
public function __construct(ParameterBagInterface $parameterBag, CenterResolverManagerInterface $centerResolverManager)
|
||||
public function __construct(ParameterBagInterface $parameterBag, private CenterResolverManagerInterface $centerResolverManager)
|
||||
{
|
||||
$this->centerRequired = $parameterBag->get('chill_person')['validation']['center_required'];
|
||||
$this->centerResolverManager = $centerResolverManager;
|
||||
}
|
||||
|
||||
public function validate($person, Constraint $constraint)
|
||||
|
Reference in New Issue
Block a user