apply rules rector up to php82

This commit is contained in:
2023-05-01 21:39:45 +02:00
parent 81e8928344
commit 6d63177ff4
733 changed files with 1257 additions and 1322 deletions

View File

@@ -74,7 +74,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
'pinnedComment' => AccompanyingPeriod\Comment::class,
];
public function __construct(private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private SocialIssueRender $socialIssueRender, private ClosingMotiveRender $closingMotiveRender, private ScopeResolverDispatcher $scopeResolverDispatcher)
public function __construct(private readonly TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper, private readonly SocialIssueRender $socialIssueRender, private readonly ClosingMotiveRender $closingMotiveRender, private readonly ScopeResolverDispatcher $scopeResolverDispatcher)
{
}

View File

@@ -32,7 +32,7 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface
use ObjectToPopulateTrait;
public function __construct(private ResourceRepository $repository)
public function __construct(private readonly ResourceRepository $repository)
{
}

View File

@@ -36,11 +36,11 @@ class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInte
use ObjectToPopulateTrait;
public const GROUP_CREATE = 'accompanying_period_work:create';
final public const GROUP_CREATE = 'accompanying_period_work:create';
public const GROUP_EDIT = 'accompanying_period_work:edit';
final public const GROUP_EDIT = 'accompanying_period_work:edit';
public function __construct(private AccompanyingPeriodWorkRepository $workRepository, private EntityManagerInterface $em)
public function __construct(private readonly AccompanyingPeriodWorkRepository $workRepository, private readonly EntityManagerInterface $em)
{
}

View File

@@ -26,7 +26,7 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements ContextAware
private const SKIP = 'accompanying_period_work_evaluation_document_skip';
public function __construct(private EntityWorkflowRepository $entityWorkflowRepository, private MetadataExtractor $metadataExtractor, private Registry $registry)
public function __construct(private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry)
{
}

View File

@@ -27,7 +27,7 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz
private const IGNORE_EVALUATION = 'evaluation:ignore';
public function __construct(private Registry $registry, private EntityWorkflowRepository $entityWorkflowRepository, private MetadataExtractor $metadataExtractor)
public function __construct(private readonly Registry $registry, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor)
{
}

View File

@@ -30,7 +30,7 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac
private const IGNORE_WORK = 'ignore:work';
public function __construct(private Registry $registry, private EntityWorkflowRepository $entityWorkflowRepository, private MetadataExtractor $metadataExtractor)
public function __construct(private readonly Registry $registry, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor)
{
}

View File

@@ -31,7 +31,7 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize
{
use DenormalizerAwareTrait;
public function __construct(private MembersEditorFactory $factory)
public function __construct(private readonly MembersEditorFactory $factory)
{
}

View File

@@ -47,7 +47,7 @@ class PersonDocGenNormalizer implements
private const CIRCULAR_KEY = 'person:circular';
public function __construct(private PersonRenderInterface $personRender, private RelationshipRepository $relationshipRepository, private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private SummaryBudgetInterface $summaryBudget)
public function __construct(private readonly PersonRenderInterface $personRender, private readonly RelationshipRepository $relationshipRepository, private readonly TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper, private readonly SummaryBudgetInterface $summaryBudget)
{
}

View File

@@ -48,12 +48,12 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
use ObjectToPopulateTrait;
public function __construct(
private ChillEntityRenderExtension $render,
private readonly ChillEntityRenderExtension $render,
/* TODO: replace by PersonRenderInterface, as sthis is the only one required */
private PersonRepository $repository,
private CenterResolverManagerInterface $centerResolverManager,
private ResidentialAddressRepository $residentialAddressRepository,
private PhoneNumberHelperInterface $phoneNumberHelper
private readonly PersonRepository $repository,
private readonly CenterResolverManagerInterface $centerResolverManager,
private readonly ResidentialAddressRepository $residentialAddressRepository,
private readonly PhoneNumberHelperInterface $phoneNumberHelper
) {
}
@@ -214,14 +214,9 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
return $data;
}
return array_merge($data, [
'centers' => $this->normalizer->normalize($this->centerResolverManager->resolveCenters($person), $format, $context),
'altNames' => $this->normalizeAltNames($person->getAltNames()),
'current_household_id' => $household ? $this->normalizer->normalize($household->getId(), $format, $context) : null,
'current_residential_addresses' => $currentResidentialAddresses ?
$this->normalizer->normalize($currentResidentialAddresses, $format, $context) :
null,
]);
return [...$data, 'centers' => $this->normalizer->normalize($this->centerResolverManager->resolveCenters($person), $format, $context), 'altNames' => $this->normalizeAltNames($person->getAltNames()), 'current_household_id' => $household ? $this->normalizer->normalize($household->getId(), $format, $context) : null, 'current_residential_addresses' => $currentResidentialAddresses ?
$this->normalizer->normalize($currentResidentialAddresses, $format, $context) :
null];
}
public function supportsDenormalization($data, $type, $format = null)

View File

@@ -22,7 +22,7 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N
{
use NormalizerAwareTrait;
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper)
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper)
{
}

View File

@@ -21,7 +21,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte
{
use NormalizerAwareTrait;
public function __construct(private SocialActionRender $render)
public function __construct(private readonly SocialActionRender $render)
{
}

View File

@@ -21,7 +21,7 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz
{
use NormalizerAwareTrait;
public function __construct(private SocialIssueRender $render)
public function __construct(private readonly SocialIssueRender $render)
{
}

View File

@@ -27,7 +27,7 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA
private const IGNORE_ENTITY_WORKFLOW = 'ignore:entity_workflow';
public function __construct(private Registry $registry, private MetadataExtractor $metadataExtractor)
public function __construct(private readonly Registry $registry, private readonly MetadataExtractor $metadataExtractor)
{
}