DX: apply rector rules up to php8.0

This commit is contained in:
2023-04-15 01:05:37 +02:00
parent d8870e906f
commit dde3002100
714 changed files with 2348 additions and 9263 deletions

View File

@@ -30,19 +30,15 @@ class PersonChoiceLoader implements ChoiceLoaderInterface
protected array $lazyLoadedPersons = [];
protected PersonRepository $personRepository;
/**
* PersonChoiceLoader constructor.
*
* @param EntityRepository $personRepository
*/
public function __construct(
PersonRepository $personRepository,
protected PersonRepository $personRepository,
?array $centers = null
) {
$this->personRepository = $personRepository;
if (null !== $centers) {
$this->centers = $centers;
}

View File

@@ -42,17 +42,11 @@ final class CreationPersonType extends AbstractType
private bool $askCenters;
private ConfigPersonAltNamesHelper $configPersonAltNamesHelper;
private EventDispatcherInterface $dispatcher;
public function __construct(
ConfigPersonAltNamesHelper $configPersonAltNamesHelper,
EventDispatcherInterface $dispatcher,
private ConfigPersonAltNamesHelper $configPersonAltNamesHelper,
private EventDispatcherInterface $dispatcher,
ParameterBagInterface $parameterBag
) {
$this->configPersonAltNamesHelper = $configPersonAltNamesHelper;
$this->dispatcher = $dispatcher;
$this->askCenters = $parameterBag->get('chill_main')['acl']['form_show_centers'];
}

View File

@@ -22,14 +22,8 @@ use Symfony\Component\Form\FormBuilderInterface;
class HouseholdCompositionType extends AbstractType
{
private HouseholdCompositionTypeRepository $householdCompositionTypeRepository;
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(HouseholdCompositionTypeRepository $householdCompositionTypeRepository, TranslatableStringHelperInterface $translatableStringHelper)
public function __construct(private HouseholdCompositionTypeRepository $householdCompositionTypeRepository, private TranslatableStringHelperInterface $translatableStringHelper)
{
$this->householdCompositionTypeRepository = $householdCompositionTypeRepository;
$this->translatableStringHelper = $translatableStringHelper;
}
public function buildForm(FormBuilderInterface $builder, array $options)

View File

@@ -29,20 +29,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final class PersonResourceType extends AbstractType
{
private PersonRenderInterface $personRender;
private ResourceKindRender $resourceKindRender;
private ThirdPartyRender $thirdPartyRender;
private TranslatorInterface $translator;
public function __construct(ResourceKindRender $resourceKindRender, PersonRenderInterface $personRender, ThirdPartyRender $thirdPartyRender, TranslatorInterface $translator)
public function __construct(private ResourceKindRender $resourceKindRender, private PersonRenderInterface $personRender, private ThirdPartyRender $thirdPartyRender, private TranslatorInterface $translator)
{
$this->resourceKindRender = $resourceKindRender;
$this->personRender = $personRender;
$this->thirdPartyRender = $thirdPartyRender;
$this->translator = $translator;
}
public function buildForm(FormBuilderInterface $builder, array $options)

View File

@@ -57,23 +57,17 @@ class PersonType extends AbstractType
*/
protected $configAltNamesHelper;
protected TranslatableStringHelper $translatableStringHelper;
private ParameterBagInterface $parameterBag;
/**
* @param string[] $personFieldsConfiguration configuration of visibility of some fields
*/
public function __construct(
array $personFieldsConfiguration,
ConfigPersonAltNamesHelper $configAltNamesHelper,
TranslatableStringHelperInterface $translatableStringHelper,
ParameterBagInterface $parameterBag
protected TranslatableStringHelperInterface $translatableStringHelper,
private ParameterBagInterface $parameterBag
) {
$this->config = $personFieldsConfiguration;
$this->configAltNamesHelper = $configAltNamesHelper;
$this->translatableStringHelper = $translatableStringHelper;
$this->parameterBag = $parameterBag;
}
public function buildForm(FormBuilderInterface $builder, array $options)

View File

@@ -23,12 +23,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class SocialIssueType extends AbstractType
{
protected TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
TranslatableStringHelperInterface $translatableStringHelper
) {
$this->translatableStringHelper = $translatableStringHelper;
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)

View File

@@ -78,10 +78,7 @@ class ClosingMotivePickerType extends AbstractType
return 'closing_motive';
}
/**
* @return string|null
*/
public function getParent()
public function getParent(): ?string
{
return EntityType::class;
}

View File

@@ -21,22 +21,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PersonAltNameType extends AbstractType
{
/**
* @var ConfigPersonAltNamesHelper
*/
private $configHelper;
/**
* @var TranslatableStringHelper
*/
private $translatableStringHelper;
public function __construct(
ConfigPersonAltNamesHelper $configHelper,
TranslatableStringHelper $translatableStringHelper
) {
$this->configHelper = $configHelper;
$this->translatableStringHelper = $translatableStringHelper;
public function __construct(private ConfigPersonAltNamesHelper $configHelper, private TranslatableStringHelper $translatableStringHelper)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)

View File

@@ -24,14 +24,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PersonPhoneType extends AbstractType
{
private EntityManagerInterface $em;
private PhonenumberHelper $phonenumberHelper;
public function __construct(PhonenumberHelper $phonenumberHelper, EntityManagerInterface $em)
public function __construct(private PhonenumberHelper $phonenumberHelper, private EntityManagerInterface $em)
{
$this->phonenumberHelper = $phonenumberHelper;
$this->em = $em;
}
public function buildForm(FormBuilderInterface $builder, array $options)

View File

@@ -26,20 +26,8 @@ use Symfony\Component\Serializer\SerializerInterface;
*/
class PickPersonDynamicType extends AbstractType
{
private DenormalizerInterface $denormalizer;
private NormalizerInterface $normalizer;
private SerializerInterface $serializer;
public function __construct(
DenormalizerInterface $denormalizer,
SerializerInterface $serializer,
NormalizerInterface $normalizer
) {
$this->denormalizer = $denormalizer;
$this->serializer = $serializer;
$this->normalizer = $normalizer;
public function __construct(private DenormalizerInterface $denormalizer, private SerializerInterface $serializer, private NormalizerInterface $normalizer)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)

View File

@@ -20,16 +20,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PickSocialActionType extends AbstractType
{
private SocialActionRender $actionRender;
private SocialActionRepository $actionRepository;
public function __construct(
SocialActionRender $actionRender,
SocialActionRepository $actionRepository
) {
$this->actionRender = $actionRender;
$this->actionRepository = $actionRepository;
public function __construct(private SocialActionRender $actionRender, private SocialActionRepository $actionRepository)
{
}
public function configureOptions(OptionsResolver $resolver)

View File

@@ -20,16 +20,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PickSocialIssueType extends AbstractType
{
private SocialIssueRender $issueRender;
private SocialIssueRepository $issueRepository;
public function __construct(
SocialIssueRender $issueRender,
SocialIssueRepository $issueRepository
) {
$this->issueRender = $issueRender;
$this->issueRepository = $issueRepository;
public function __construct(private SocialIssueRender $issueRender, private SocialIssueRepository $issueRepository)
{
}
public function configureOptions(OptionsResolver $resolver)

View File

@@ -28,14 +28,8 @@ use const SORT_STRING;
*/
class Select2MaritalStatusType extends AbstractType
{
private EntityManagerInterface $em;
private TranslatableStringHelper $translatableStringHelper;
public function __construct(TranslatableStringHelper $translatableStringHelper, EntityManagerInterface $em)
public function __construct(private TranslatableStringHelper $translatableStringHelper, private EntityManagerInterface $em)
{
$this->translatableStringHelper = $translatableStringHelper;
$this->em = $em;
}
public function buildForm(FormBuilderInterface $builder, array $options)