mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -74,28 +74,8 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
|
||||
'pinnedComment' => AccompanyingPeriod\Comment::class,
|
||||
];
|
||||
|
||||
private ClosingMotiveRender $closingMotiveRender;
|
||||
|
||||
private ScopeResolverDispatcher $scopeResolverDispatcher;
|
||||
|
||||
private SocialIssueRender $socialIssueRender;
|
||||
|
||||
private TranslatableStringHelper $translatableStringHelper;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
TranslatorInterface $translator,
|
||||
TranslatableStringHelper $translatableStringHelper,
|
||||
SocialIssueRender $socialIssueRender,
|
||||
ClosingMotiveRender $closingMotiveRender,
|
||||
ScopeResolverDispatcher $scopeResolverDispatcher
|
||||
) {
|
||||
$this->translator = $translator;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
$this->socialIssueRender = $socialIssueRender;
|
||||
$this->closingMotiveRender = $closingMotiveRender;
|
||||
$this->scopeResolverDispatcher = $scopeResolverDispatcher;
|
||||
public function __construct(private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private SocialIssueRender $socialIssueRender, private ClosingMotiveRender $closingMotiveRender, private ScopeResolverDispatcher $scopeResolverDispatcher)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -32,11 +32,8 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface
|
||||
|
||||
use ObjectToPopulateTrait;
|
||||
|
||||
private ResourceRepository $repository;
|
||||
|
||||
public function __construct(ResourceRepository $repository)
|
||||
public function __construct(private ResourceRepository $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
|
@@ -40,16 +40,8 @@ class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInte
|
||||
|
||||
public const GROUP_EDIT = 'accompanying_period_work:edit';
|
||||
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
private AccompanyingPeriodWorkRepository $workRepository;
|
||||
|
||||
public function __construct(
|
||||
AccompanyingPeriodWorkRepository $workRepository,
|
||||
EntityManagerInterface $em
|
||||
) {
|
||||
$this->workRepository = $workRepository;
|
||||
$this->em = $em;
|
||||
public function __construct(private AccompanyingPeriodWorkRepository $workRepository, private EntityManagerInterface $em)
|
||||
{
|
||||
}
|
||||
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
|
@@ -26,17 +26,8 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements ContextAware
|
||||
|
||||
private const SKIP = 'accompanying_period_work_evaluation_document_skip';
|
||||
|
||||
private EntityWorkflowRepository $entityWorkflowRepository;
|
||||
|
||||
private MetadataExtractor $metadataExtractor;
|
||||
|
||||
private Registry $registry;
|
||||
|
||||
public function __construct(EntityWorkflowRepository $entityWorkflowRepository, MetadataExtractor $metadataExtractor, Registry $registry)
|
||||
public function __construct(private EntityWorkflowRepository $entityWorkflowRepository, private MetadataExtractor $metadataExtractor, private Registry $registry)
|
||||
{
|
||||
$this->entityWorkflowRepository = $entityWorkflowRepository;
|
||||
$this->metadataExtractor = $metadataExtractor;
|
||||
$this->registry = $registry;
|
||||
}
|
||||
|
||||
public function normalize($object, ?string $format = null, array $context = []): array
|
||||
|
@@ -27,17 +27,8 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz
|
||||
|
||||
private const IGNORE_EVALUATION = 'evaluation:ignore';
|
||||
|
||||
private EntityWorkflowRepository $entityWorkflowRepository;
|
||||
|
||||
private MetadataExtractor $metadataExtractor;
|
||||
|
||||
private Registry $registry;
|
||||
|
||||
public function __construct(Registry $registry, EntityWorkflowRepository $entityWorkflowRepository, MetadataExtractor $metadataExtractor)
|
||||
public function __construct(private Registry $registry, private EntityWorkflowRepository $entityWorkflowRepository, private MetadataExtractor $metadataExtractor)
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->entityWorkflowRepository = $entityWorkflowRepository;
|
||||
$this->metadataExtractor = $metadataExtractor;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -30,27 +30,16 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac
|
||||
|
||||
private const IGNORE_WORK = 'ignore:work';
|
||||
|
||||
private EntityWorkflowRepository $entityWorkflowRepository;
|
||||
|
||||
private MetadataExtractor $metadataExtractor;
|
||||
|
||||
private Registry $registry;
|
||||
|
||||
public function __construct(Registry $registry, EntityWorkflowRepository $entityWorkflowRepository, MetadataExtractor $metadataExtractor)
|
||||
public function __construct(private Registry $registry, private EntityWorkflowRepository $entityWorkflowRepository, private MetadataExtractor $metadataExtractor)
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->entityWorkflowRepository = $entityWorkflowRepository;
|
||||
$this->metadataExtractor = $metadataExtractor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWork $object
|
||||
*
|
||||
* @throws ExceptionInterface
|
||||
*
|
||||
* @return array|ArrayObject|bool|float|int|string|null
|
||||
*/
|
||||
public function normalize($object, ?string $format = null, array $context = [])
|
||||
public function normalize($object, ?string $format = null, array $context = []): array|\ArrayObject|bool|float|int|string|null
|
||||
{
|
||||
$initial = $this->normalizer->normalize($object, $format, array_merge(
|
||||
$context,
|
||||
|
@@ -31,11 +31,8 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize
|
||||
{
|
||||
use DenormalizerAwareTrait;
|
||||
|
||||
private MembersEditorFactory $factory;
|
||||
|
||||
public function __construct(MembersEditorFactory $factory)
|
||||
public function __construct(private MembersEditorFactory $factory)
|
||||
{
|
||||
$this->factory = $factory;
|
||||
}
|
||||
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
|
@@ -47,35 +47,15 @@ class PersonDocGenNormalizer implements
|
||||
|
||||
private const CIRCULAR_KEY = 'person:circular';
|
||||
|
||||
private PersonRenderInterface $personRender;
|
||||
|
||||
private RelationshipRepository $relationshipRepository;
|
||||
|
||||
private SummaryBudgetInterface $summaryBudget;
|
||||
|
||||
private TranslatableStringHelper $translatableStringHelper;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
PersonRenderInterface $personRender,
|
||||
RelationshipRepository $relationshipRepository,
|
||||
TranslatorInterface $translator,
|
||||
TranslatableStringHelper $translatableStringHelper,
|
||||
SummaryBudgetInterface $summaryBudget
|
||||
) {
|
||||
$this->personRender = $personRender;
|
||||
$this->relationshipRepository = $relationshipRepository;
|
||||
$this->translator = $translator;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
$this->summaryBudget = $summaryBudget;
|
||||
public function __construct(private PersonRenderInterface $personRender, private RelationshipRepository $relationshipRepository, private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private SummaryBudgetInterface $summaryBudget)
|
||||
{
|
||||
}
|
||||
|
||||
public function normalize($person, $format = null, array $context = [])
|
||||
{
|
||||
try {
|
||||
$context = $this->addCircularToContext($person, $context);
|
||||
} catch (CircularReferenceException $circularReferenceException) {
|
||||
} catch (CircularReferenceException) {
|
||||
return [
|
||||
'isNull' => true,
|
||||
'isCircular' => true,
|
||||
|
@@ -47,28 +47,14 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
|
||||
|
||||
use ObjectToPopulateTrait;
|
||||
|
||||
private CenterResolverManagerInterface $centerResolverManager;
|
||||
|
||||
private PhoneNumberHelperInterface $phoneNumberHelper;
|
||||
|
||||
private ChillEntityRenderExtension $render;
|
||||
|
||||
private PersonRepository $repository;
|
||||
|
||||
private ResidentialAddressRepository $residentialAddressRepository;
|
||||
|
||||
public function __construct(
|
||||
ChillEntityRenderExtension $render, /* TODO: replace by PersonRenderInterface, as sthis is the only one required */
|
||||
PersonRepository $repository,
|
||||
CenterResolverManagerInterface $centerResolverManager,
|
||||
ResidentialAddressRepository $residentialAddressRepository,
|
||||
PhoneNumberHelperInterface $phoneNumberHelper /* TODO maybe not necessayr any more */
|
||||
private 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
|
||||
) {
|
||||
$this->render = $render;
|
||||
$this->repository = $repository;
|
||||
$this->centerResolverManager = $centerResolverManager;
|
||||
$this->residentialAddressRepository = $residentialAddressRepository;
|
||||
$this->phoneNumberHelper = $phoneNumberHelper;
|
||||
}
|
||||
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
|
@@ -22,11 +22,8 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||
|
||||
public function __construct(TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,11 +21,8 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private SocialActionRender $render;
|
||||
|
||||
public function __construct(SocialActionRender $render)
|
||||
public function __construct(private SocialActionRender $render)
|
||||
{
|
||||
$this->render = $render;
|
||||
}
|
||||
|
||||
public function normalize($socialAction, $format = null, array $context = [])
|
||||
|
@@ -21,11 +21,8 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private SocialIssueRender $render;
|
||||
|
||||
public function __construct(SocialIssueRender $render)
|
||||
public function __construct(private SocialIssueRender $render)
|
||||
{
|
||||
$this->render = $render;
|
||||
}
|
||||
|
||||
public function normalize($socialIssue, $format = null, array $context = [])
|
||||
|
@@ -27,14 +27,8 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA
|
||||
|
||||
private const IGNORE_ENTITY_WORKFLOW = 'ignore:entity_workflow';
|
||||
|
||||
private MetadataExtractor $metadataExtractor;
|
||||
|
||||
private Registry $registry;
|
||||
|
||||
public function __construct(Registry $registry, MetadataExtractor $metadataExtractor)
|
||||
public function __construct(private Registry $registry, private MetadataExtractor $metadataExtractor)
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->metadataExtractor = $metadataExtractor;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user