mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -25,17 +25,8 @@ use function in_array;
|
||||
|
||||
class AccompanyingPeriodValidityValidator extends ConstraintValidator
|
||||
{
|
||||
private ActivityRepository $activityRepository;
|
||||
|
||||
private SocialIssueRender $socialIssueRender;
|
||||
|
||||
private TokenStorageInterface $token;
|
||||
|
||||
public function __construct(ActivityRepository $activityRepository, SocialIssueRender $socialIssueRender, TokenStorageInterface $token)
|
||||
public function __construct(private ActivityRepository $activityRepository, private SocialIssueRender $socialIssueRender, private TokenStorageInterface $token)
|
||||
{
|
||||
$this->activityRepository = $activityRepository;
|
||||
$this->socialIssueRender = $socialIssueRender;
|
||||
$this->token = $token;
|
||||
}
|
||||
|
||||
public function validate($period, Constraint $constraint)
|
||||
|
@@ -20,11 +20,8 @@ use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||
|
||||
class LocationValidityValidator extends ConstraintValidator
|
||||
{
|
||||
private PersonRenderInterface $render;
|
||||
|
||||
public function __construct(PersonRenderInterface $render)
|
||||
public function __construct(private PersonRenderInterface $render)
|
||||
{
|
||||
$this->render = $render;
|
||||
}
|
||||
|
||||
public function validate($period, Constraint $constraint)
|
||||
|
@@ -26,14 +26,8 @@ class ParticipationOverlapValidator extends ConstraintValidator
|
||||
{
|
||||
private const MAX_PARTICIPATION = 1;
|
||||
|
||||
private PersonRenderInterface $personRender;
|
||||
|
||||
private ThirdPartyRender $thirdpartyRender;
|
||||
|
||||
public function __construct(PersonRenderInterface $personRender, ThirdPartyRender $thirdPartyRender)
|
||||
public function __construct(private PersonRenderInterface $personRender, private ThirdPartyRender $thirdpartyRender)
|
||||
{
|
||||
$this->personRender = $personRender;
|
||||
$this->thirdpartyRender = $thirdPartyRender;
|
||||
}
|
||||
|
||||
public function validate($participations, Constraint $constraint)
|
||||
|
@@ -24,14 +24,8 @@ use function in_array;
|
||||
|
||||
class ResourceDuplicateCheckValidator extends ConstraintValidator
|
||||
{
|
||||
private PersonRenderInterface $personRender;
|
||||
|
||||
private ThirdPartyRender $thirdpartyRender;
|
||||
|
||||
public function __construct(PersonRenderInterface $personRender, ThirdPartyRender $thirdPartyRender)
|
||||
public function __construct(private PersonRenderInterface $personRender, private ThirdPartyRender $thirdpartyRender)
|
||||
{
|
||||
$this->personRender = $personRender;
|
||||
$this->thirdpartyRender = $thirdPartyRender;
|
||||
}
|
||||
|
||||
public function validate($resources, Constraint $constraint)
|
||||
|
@@ -26,11 +26,8 @@ use function count;
|
||||
*/
|
||||
class HouseholdMembershipSequentialValidator extends ConstraintValidator
|
||||
{
|
||||
private PersonRenderInterface $render;
|
||||
|
||||
public function __construct(PersonRenderInterface $render)
|
||||
public function __construct(private PersonRenderInterface $render)
|
||||
{
|
||||
$this->render = $render;
|
||||
}
|
||||
|
||||
public function validate($person, Constraint $constraint)
|
||||
|
@@ -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)
|
||||
|
@@ -20,11 +20,8 @@ use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||
|
||||
class RelationshipNoDuplicateValidator extends ConstraintValidator
|
||||
{
|
||||
private RelationshipRepository $relationshipRepository;
|
||||
|
||||
public function __construct(RelationshipRepository $relationshipRepository)
|
||||
public function __construct(private RelationshipRepository $relationshipRepository)
|
||||
{
|
||||
$this->relationshipRepository = $relationshipRepository;
|
||||
}
|
||||
|
||||
public function validate($value, Constraint $constraint)
|
||||
|
Reference in New Issue
Block a user