Merge branch 'master' into upgrade-sf5

This commit is contained in:
2024-02-12 21:50:34 +01:00
920 changed files with 6430 additions and 1914 deletions

View File

@@ -22,7 +22,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class PersonAddressMoveEventSubscriber implements EventSubscriberInterface
{
public function __construct(private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister, private readonly Security $security, private readonly TranslatorInterface $translator) {}
public function __construct(private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister, private readonly Security $security, private readonly TranslatorInterface $translator)
{
}
public static function getSubscribedEvents(): array
{

View File

@@ -23,7 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class UserRefEventSubscriber implements EventSubscriberInterface
{
public function __construct(private readonly Security $security, private readonly TranslatorInterface $translator, private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister) {}
public function __construct(private readonly Security $security, private readonly TranslatorInterface $translator, private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister)
{
}
public static function getSubscribedEvents()
{

View File

@@ -20,7 +20,8 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface
public function __construct(
private ClockInterface $clock,
private AccompanyingPeriodStepChangeRequestor $requestor,
) {}
) {
}
public function canRun(?CronJobExecution $cronJobExecution): bool
{
@@ -38,7 +39,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface
return 'accompanying-period-step-change';
}
public function run(array $lastExecutionData): null|array
public function run(array $lastExecutionData): array|null
{
($this->requestor)();

View File

@@ -23,7 +23,8 @@ class AccompanyingPeriodStepChangeMessageHandler implements MessageHandlerInterf
public function __construct(
private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository,
private readonly AccompanyingPeriodStepChanger $changer,
) {}
) {
}
public function __invoke(AccompanyingPeriodStepChangeRequestMessage $message): void
{

View File

@@ -30,9 +30,10 @@ class AccompanyingPeriodStepChanger
private readonly EntityManagerInterface $entityManager,
private readonly LoggerInterface $logger,
private readonly Registry $workflowRegistry,
) {}
) {
}
public function __invoke(AccompanyingPeriod $period, string $transition, string $workflowName = null): void
public function __invoke(AccompanyingPeriod $period, string $transition, ?string $workflowName = null): void
{
$workflow = $this->workflowRegistry->get($period, $workflowName);

View File

@@ -52,7 +52,8 @@ class ActionEvent extends \Symfony\Contracts\EventDispatcher\Event
* an array of key value data to describe the movement.
*/
protected $metadata = []
) {}
) {
}
/**
* Add Sql which will be executed **after** the delete statement.

View File

@@ -26,7 +26,7 @@ class PersonMoveAccompanyingPeriodParticipationHandler implements PersonMoveSqlH
{
$insertSql = sprintf(<<<'SQL'
INSERT INTO chill_person_accompanying_period_participation (person_id, accompanyingperiod_id, id, startdate, enddate)
SELECT %d, accompanyingperiod_id, nextval('chill_person_accompanying_period_id_seq'), startdate, enddate
SELECT %d, accompanyingperiod_id, nextval('chill_person_accompanying_period_participation_id_seq'), startdate, enddate
FROM chill_person_accompanying_period_participation cpapp
WHERE person_id = %d
AND NOT EXISTS (

View File

@@ -19,7 +19,8 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface
{
public function __construct(
private readonly PersonCenterHistoryRepository $centerHistoryRepository,
) {}
) {
}
public function supports(string $className, string $field): bool
{

View File

@@ -33,7 +33,8 @@ class PersonMove
private readonly EntityManagerInterface $em,
private readonly PersonMoveManager $personMoveManager,
private readonly EventDispatcherInterface $eventDispatcher
) {}
) {
}
/**
* Return the sql used to move or delete entities associated to a person to

View File

@@ -20,7 +20,8 @@ class PersonMoveManager
* @var iterable<PersonMoveSqlHandlerInterface>
*/
private readonly iterable $handlers,
) {}
) {
}
/**
* @param class-string $className

View File

@@ -24,7 +24,8 @@ class ConfigPersonAltNamesHelper
* the raw config, directly from the container parameter.
*/
private $config
) {}
) {
}
/**
* get the choices as key => values.

View File

@@ -46,7 +46,9 @@ use Symfony\Component\Workflow\Registry;
final class AccompanyingCourseApiController extends ApiController
{
public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly AccompanyingPeriodACLAwareRepository $accompanyingPeriodACLAwareRepository, private readonly EventDispatcherInterface $eventDispatcher, private readonly ReferralsSuggestionInterface $referralAvailable, private readonly Registry $registry, private readonly ValidatorInterface $validator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly AccompanyingPeriodACLAwareRepository $accompanyingPeriodACLAwareRepository, private readonly EventDispatcherInterface $eventDispatcher, private readonly ReferralsSuggestionInterface $referralAvailable, private readonly Registry $registry, private readonly ValidatorInterface $validator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
{
}
public function commentApi($id, Request $request, string $_format): Response
{

View File

@@ -30,7 +30,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class AccompanyingCourseCommentController extends AbstractController
{
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly FormFactoryInterface $formFactory, private readonly TranslatorInterface $translator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly FormFactoryInterface $formFactory, private readonly TranslatorInterface $translator)
{
}
/**
* Page of comments in Accompanying Course section.

View File

@@ -70,7 +70,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle
$workflow = $this->registry->get($accompanyingCourse);
if ($workflow->can($accompanyingCourse, 'close')) {
$workflow->apply($accompanyingCourse, 'close');
$workflow->apply($accompanyingCourse, 'close', ['closing_motive' => $form['closingMotive']->getData()]);
$em->flush();

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Security\Core\Security;
class AccompanyingCourseWorkEvaluationDocumentController extends AbstractController
{
public function __construct(private readonly Security $security) {}
public function __construct(private readonly Security $security)
{
}
/**
* @Route(

View File

@@ -31,7 +31,9 @@ use Symfony\Component\Security\Core\Security;
class AccompanyingPeriodRegulationListController
{
public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper)
{
}
/**
* @Route("/{_locale}/person/periods/undispatched", name="chill_person_course_list_regulation")

View File

@@ -29,7 +29,9 @@ use Symfony\Component\Serializer\SerializerInterface;
class AccompanyingPeriodWorkEvaluationApiController
{
public function __construct(private readonly AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository, private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly SerializerInterface $serializer, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security) {}
public function __construct(private readonly AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository, private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly SerializerInterface $serializer, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security)
{
}
/**
* @Route("/api/1.0/person/docgen/template/by-evaluation/{id}.{_format}",

View File

@@ -44,7 +44,8 @@ class HouseholdCompositionController extends AbstractController
private readonly TranslatorInterface $translator,
private readonly \Twig\Environment $engine,
private readonly UrlGeneratorInterface $urlGenerator
) {}
) {
}
/**
* @Route("/{_locale}/person/household/{household_id}/composition/{composition_id}/delete", name="chill_person_household_composition_delete")

View File

@@ -34,7 +34,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
class HouseholdController extends AbstractController
{
public function __construct(private readonly TranslatorInterface $translator, private readonly PositionRepository $positionRepository, private readonly SerializerInterface $serializer, private readonly Security $security, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
public function __construct(private readonly TranslatorInterface $translator, private readonly PositionRepository $positionRepository, private readonly SerializerInterface $serializer, private readonly Security $security, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
{
}
/**
* @Route(

View File

@@ -45,7 +45,9 @@ class HouseholdMemberController extends ApiController
private readonly Security $security,
private readonly PositionRepository $positionRepository,
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
) {}
)
{
}
/**
* @Route(

View File

@@ -29,7 +29,9 @@ class PersonAddressController extends AbstractController
/**
* PersonAddressController constructor.
*/
public function __construct(private readonly ValidatorInterface $validator, private readonly TranslatorInterface $translator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
public function __construct(private readonly ValidatorInterface $validator, private readonly TranslatorInterface $translator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
{
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/create", name="chill_person_address_create", methods={"POST"})

View File

@@ -47,7 +47,8 @@ final class PersonController extends AbstractController
private readonly ConfigPersonAltNamesHelper $configPersonAltNameHelper,
private readonly ValidatorInterface $validator,
private readonly EntityManagerInterface $em,
) {}
) {
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/general/edit", name="chill_person_general_edit")

View File

@@ -40,7 +40,9 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
private readonly EventDispatcherInterface $eventDispatcher,
private readonly Security $security,
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
) {}
)
{
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/confirm", name="chill_person_duplicate_confirm")

View File

@@ -25,7 +25,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final class PersonResourceController extends AbstractController
{
public function __construct(private readonly PersonResourceRepository $personResourceRepository, private readonly PersonRepository $personRepository, private readonly EntityManagerInterface $em, private readonly TranslatorInterface $translator) {}
public function __construct(private readonly PersonResourceRepository $personResourceRepository, private readonly PersonRepository $personRepository, private readonly EntityManagerInterface $em, private readonly TranslatorInterface $translator)
{
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/{resource_id}/delete", name="chill_person_resource_delete")

View File

@@ -39,7 +39,9 @@ use Symfony\Component\Validator\Constraints\NotNull;
class ReassignAccompanyingPeriodController extends AbstractController
{
public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly UserRepository $userRepository, private readonly AccompanyingPeriodRepository $courseRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly UserRender $userRender, private readonly EntityManagerInterface $em) {}
public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly UserRepository $userRepository, private readonly AccompanyingPeriodRepository $courseRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly UserRender $userRender, private readonly EntityManagerInterface $em)
{
}
/**
* @Route("/{_locale}/person/accompanying-periods/reassign", name="chill_course_list_reassign")
@@ -141,7 +143,7 @@ class ReassignAccompanyingPeriodController extends AbstractController
return $builder->getForm();
}
private function buildReassignForm(array $periodIds, User $userFrom = null): FormInterface
private function buildReassignForm(array $periodIds, ?User $userFrom = null): FormInterface
{
$defaultData = [
'userFrom' => $userFrom,

View File

@@ -21,7 +21,9 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
class RelationshipApiController extends ApiController
{
public function __construct(private readonly ValidatorInterface $validator, private readonly RelationshipRepository $repository) {}
public function __construct(private readonly ValidatorInterface $validator, private readonly RelationshipRepository $repository)
{
}
/**
* @ParamConverter("person", options={"id": "person_id"})

View File

@@ -27,7 +27,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final class ResidentialAddressController extends AbstractController
{
public function __construct(private readonly UrlGeneratorInterface $generator, private readonly TranslatorInterface $translator, private readonly ResidentialAddressRepository $residentialAddressRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
public function __construct(private readonly UrlGeneratorInterface $generator, private readonly TranslatorInterface $translator, private readonly ResidentialAddressRepository $residentialAddressRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
{
}
/**
* @Route("/{_locale}/person/residential-address/{id}/delete", name="chill_person_residential_address_delete")

View File

@@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Request;
class SocialIssueController extends CRUDController
{
protected function createFormFor(string $action, $entity, string $formClass = null, array $formOptions = []): FormInterface
protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface
{
if ('new' === $action) {
return parent::createFormFor($action, $entity, $formClass, ['step' => 'create']);

View File

@@ -22,7 +22,9 @@ use Symfony\Component\Routing\Annotation\Route;
class SocialWorkEvaluationApiController extends AbstractController
{
public function __construct(private readonly PaginatorFactory $paginatorFactory) {}
public function __construct(private readonly PaginatorFactory $paginatorFactory)
{
}
/**
* @Route("/api/1.0/person/social-work/evaluation/by-social-action/{action_id}.json",

View File

@@ -21,7 +21,9 @@ use Symfony\Component\HttpFoundation\Response;
class SocialWorkGoalApiController extends ApiController
{
public function __construct(private readonly GoalRepository $goalRepository, private readonly PaginatorFactory $paginator) {}
public function __construct(private readonly GoalRepository $goalRepository, private readonly PaginatorFactory $paginator)
{
}
public function listBySocialAction(Request $request, SocialAction $action): Response
{

View File

@@ -21,7 +21,9 @@ use Symfony\Component\HttpFoundation\Response;
class SocialWorkResultApiController extends ApiController
{
public function __construct(private readonly ResultRepository $resultRepository) {}
public function __construct(private readonly ResultRepository $resultRepository)
{
}
public function listByGoal(Request $request, Goal $goal): Response
{

View File

@@ -26,7 +26,8 @@ final class SocialWorkSocialActionApiController extends ApiController
private readonly SocialIssueRepository $socialIssueRepository,
private readonly PaginatorFactory $paginator,
private readonly ClockInterface $clock,
) {}
) {
}
public function listBySocialIssueApi($id, Request $request)
{

View File

@@ -22,7 +22,9 @@ use Symfony\Component\HttpFoundation\Request;
class TimelinePersonController extends AbstractController
{
public function __construct(protected EventDispatcherInterface $eventDispatcher, protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
public function __construct(protected EventDispatcherInterface $eventDispatcher, protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
{
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/timeline", name="chill_person_timeline")

View File

@@ -21,7 +21,9 @@ use Symfony\Component\Routing\Annotation\Route;
class UserAccompanyingPeriodController extends AbstractController
{
public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly PaginatorFactory $paginatorFactory) {}
public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly PaginatorFactory $paginatorFactory)
{
}
/**
* @Route("/{_locale}/person/accompanying-periods/my", name="chill_person_accompanying_period_user")

View File

@@ -26,7 +26,9 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture
*/
private array $cacheEvaluations = [];
public function __construct(private readonly AccompanyingPeriodRepository $periodRepository, private readonly EvaluationRepository $evaluationRepository) {}
public function __construct(private readonly AccompanyingPeriodRepository $periodRepository, private readonly EvaluationRepository $evaluationRepository)
{
}
public function getDependencies()
{

View File

@@ -25,9 +25,9 @@ use Doctrine\Persistence\ObjectManager;
class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterface
{
private ?\Chill\CustomFieldsBundle\Entity\CustomField $cfText = null;
private ?CustomField $cfText = null;
private ?\Chill\CustomFieldsBundle\Entity\CustomField $cfChoice = null;
private ?CustomField $cfChoice = null;
/**
* /**
@@ -37,7 +37,8 @@ class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterfac
private readonly EntityManagerInterface $entityManager,
private readonly CustomFieldChoice $customFieldChoice,
private readonly CustomFieldText $customFieldText,
) {}
) {
}
// put your code here
public function getOrder()

View File

@@ -24,7 +24,9 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface
{
use PersonRandomHelper;
public function __construct(private readonly EntityManagerInterface $em) {}
public function __construct(private readonly EntityManagerInterface $em)
{
}
public function getDependencies(): array
{

View File

@@ -19,7 +19,9 @@ use League\Csv\Reader;
class LoadSocialWorkMetadata extends Fixture implements OrderedFixtureInterface
{
public function __construct(private readonly SocialWorkMetadata $importer) {}
public function __construct(private readonly SocialWorkMetadata $importer)
{
}
public function getOrder()
{

View File

@@ -98,6 +98,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
$loader->load('services/exports_accompanying_course.yaml');
$loader->load('services/exports_social_actions.yaml');
$loader->load('services/exports_evaluation.yaml');
$loader->load('services/exports_accompanying_period_step_history.yaml');
}
$loader->load('services/exports_household.yaml');
@@ -147,7 +148,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
$container->prependExtensionConfig('chill_main', [
'cruds' => [
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class,
'class' => AccompanyingPeriod\ClosingMotive::class,
'name' => 'closing_motive',
'base_path' => '/admin/person/closing-motive',
'form_class' => \Chill\PersonBundle\Form\ClosingMotiveType::class,
@@ -168,7 +169,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class,
'class' => AccompanyingPeriod\Origin::class,
'name' => 'origin',
'base_path' => '/admin/person/origin',
'form_class' => \Chill\PersonBundle\Form\OriginType::class,
@@ -535,7 +536,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Comment::class,
'class' => AccompanyingPeriod\Comment::class,
'name' => 'accompanying_period_comment',
'base_path' => '/api/1.0/person/accompanying-period/comment',
'base_role' => 'ROLE_USER',
@@ -554,7 +555,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Resource::class,
'class' => AccompanyingPeriod\Resource::class,
'name' => 'accompanying_period_resource',
'base_path' => '/api/1.0/person/accompanying-period/resource',
'base_role' => 'ROLE_USER',
@@ -573,7 +574,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class,
'class' => AccompanyingPeriod\Origin::class,
'name' => 'accompanying_period_origin',
'base_path' => '/api/1.0/person/accompanying-period/origin',
'controller' => \Chill\PersonBundle\Controller\OpeningApiController::class,
@@ -718,7 +719,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork::class,
'class' => AccompanyingPeriod\AccompanyingPeriodWork::class,
'name' => 'accompanying_period_work',
'base_path' => '/api/1.0/person/accompanying-course/work',
'controller' => \Chill\PersonBundle\Controller\AccompanyingCourseWorkApiController::class,

View File

@@ -40,7 +40,7 @@ abstract class AddressPart extends FunctionNode
'country_id',
];
private null|\Doctrine\ORM\Query\AST\Node|string $date = null;
private \Doctrine\ORM\Query\AST\Node|string|null $date = null;
/**
* @var \Doctrine\ORM\Query\AST\Node

View File

@@ -479,7 +479,7 @@ class AccompanyingPeriod implements
*
* @uses AccompanyingPeriod::setClosingDate()
*/
public function __construct(\DateTime $dateOpening = null)
public function __construct(?\DateTime $dateOpening = null)
{
$this->calendars = new ArrayCollection(); // TODO we cannot add a dependency between AccompanyingPeriod and calendars
$this->participations = new ArrayCollection();
@@ -575,7 +575,7 @@ class AccompanyingPeriod implements
return $this;
}
public function addPerson(Person $person = null): self
public function addPerson(?Person $person = null): self
{
if (null !== $person) {
$this->createParticipationFor($person);
@@ -829,7 +829,7 @@ class AccompanyingPeriod implements
*
* @Groups({"read"})
*/
public function getLocation(\DateTimeImmutable $at = null): ?Address
public function getLocation(?\DateTimeImmutable $at = null): ?Address
{
if ($this->getPersonLocation() instanceof Person) {
return $this->getPersonLocation()->getCurrentPersonAddress();
@@ -1029,7 +1029,7 @@ class AccompanyingPeriod implements
/**
* @Groups({"read"})
*/
public function getRequestor(): null|Person|ThirdParty
public function getRequestor(): Person|ThirdParty|null
{
return $this->requestorPerson ?? $this->requestorThirdParty;
}
@@ -1257,7 +1257,7 @@ class AccompanyingPeriod implements
/**
* @Groups({"write"})
*/
public function setAddressLocation(Address $addressLocation = null): self
public function setAddressLocation(?Address $addressLocation = null): self
{
if ($this->addressLocation !== $addressLocation) {
$this->addressLocation = $addressLocation;
@@ -1297,7 +1297,7 @@ class AccompanyingPeriod implements
return $this;
}
public function setClosingMotive(ClosingMotive $closingMotive = null): self
public function setClosingMotive(?ClosingMotive $closingMotive = null): self
{
$this->closingMotive = $closingMotive;
@@ -1372,7 +1372,7 @@ class AccompanyingPeriod implements
/**
* @Groups({"write"})
*/
public function setPersonLocation(Person $person = null): self
public function setPersonLocation(?Person $person = null): self
{
if ($this->personLocation !== $person) {
$this->personLocation = $person;
@@ -1394,7 +1394,7 @@ class AccompanyingPeriod implements
/**
* @Groups({"write"})
*/
public function setPinnedComment(Comment $comment = null): self
public function setPinnedComment(?Comment $comment = null): self
{
if (null !== $this->pinnedComment) {
$this->addComment($this->pinnedComment);
@@ -1405,7 +1405,7 @@ class AccompanyingPeriod implements
return $this;
}
public function setRemark(string $remark = null): self
public function setRemark(?string $remark = null): self
{
$this->remark = (string) $remark;
@@ -1449,7 +1449,7 @@ class AccompanyingPeriod implements
return $this;
}
public function setStep(string $step): self
public function setStep(string $step, array $context = []): self
{
$previous = $this->step;
@@ -1464,7 +1464,7 @@ class AccompanyingPeriod implements
$history = new AccompanyingPeriodStepHistory();
$history->setStep($this->step)->setStartDate(new \DateTimeImmutable('now'));
$this->addStepHistory($history);
$this->addStepHistory($history, $context);
}
return $this;
@@ -1507,11 +1507,14 @@ class AccompanyingPeriod implements
return $this;
}
private function addStepHistory(AccompanyingPeriodStepHistory $stepHistory): self
private function addStepHistory(AccompanyingPeriodStepHistory $stepHistory, array $context = []): self
{
if (!$this->stepHistories->contains($stepHistory)) {
$this->stepHistories[] = $stepHistory;
$stepHistory->setPeriod($this);
if (($context['closing_motive'] ?? null) instanceof ClosingMotive) {
$stepHistory->setClosingMotive($context['closing_motive']);
}
$this->ensureStepContinuity();
}
@@ -1566,14 +1569,14 @@ class AccompanyingPeriod implements
} while ($steps->valid());
}
private function setRequestorPerson(Person $requestorPerson = null): self
private function setRequestorPerson(?Person $requestorPerson = null): self
{
$this->requestorPerson = $requestorPerson;
return $this;
}
private function setRequestorThirdParty(ThirdParty $requestorThirdParty = null): self
private function setRequestorThirdParty(?ThirdParty $requestorThirdParty = null): self
{
$this->requestorThirdParty = $requestorThirdParty;

View File

@@ -84,5 +84,6 @@ class AccompanyingPeriodInfo
* @ORM\Column(type="text")
*/
public readonly string $discriminator,
) {}
) {
}
}

View File

@@ -59,6 +59,13 @@ class AccompanyingPeriodStepHistory implements TrackCreationInterface, TrackUpda
*/
private string $step;
/**
* @ORM\ManyToOne(targetEntity=ClosingMotive::class)
*
* @ORM\JoinColumn(nullable=true)
*/
private ?ClosingMotive $closingMotive = null;
public function getEndDate(): ?\DateTimeImmutable
{
return $this->endDate;
@@ -114,4 +121,16 @@ class AccompanyingPeriodStepHistory implements TrackCreationInterface, TrackUpda
return $this;
}
public function getClosingMotive(): ?ClosingMotive
{
return $this->closingMotive;
}
public function setClosingMotive(?ClosingMotive $closingMotive): self
{
$this->closingMotive = $closingMotive;
return $this;
}
}

View File

@@ -244,6 +244,15 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
*/
private ?User $updatedBy = null;
/**
* @ORM\Column(type="integer", nullable=false, options={"default": 1})
*
* @Serializer\Groups({"read", "accompanying_period_work:edit"})
*
* @ORM\Version
*/
private int $version = 1;
public function __construct()
{
$this->goals = new ArrayCollection();
@@ -452,6 +461,18 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
return $this->updatedBy;
}
public function getVersion(): int
{
return $this->version;
}
public function setVersion(int $version): self
{
$this->version = $version;
return $this;
}
public function removeAccompanyingPeriodWorkEvaluation(AccompanyingPeriodWorkEvaluation $evaluation): self
{
$this->accompanyingPeriodWorkEvaluations
@@ -563,7 +584,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
return $this;
}
public function setEndDate(\DateTimeInterface $endDate = null): self
public function setEndDate(?\DateTimeInterface $endDate = null): self
{
$this->endDate = $endDate;

View File

@@ -35,7 +35,7 @@ class AccompanyingPeriodWorkGoal
/**
* @ORM\ManyToOne(targetEntity=AccompanyingPeriodWork::class, inversedBy="goals")
*/
private ?\Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork $accompanyingPeriodWork = null;
private ?AccompanyingPeriodWork $accompanyingPeriodWork = null;
/**
* @ORM\ManyToOne(targetEntity=Goal::class)

View File

@@ -59,7 +59,8 @@ class AccompanyingPeriodWorkReferrerHistory implements TrackCreationInterface, T
* @ORM\Column(type="date_immutable", nullable=false)
*/
private \DateTimeImmutable $startDate
) {}
) {
}
public function getId(): ?int
{

View File

@@ -107,7 +107,7 @@ class Resource
/**
* @Groups({"read"})
*/
public function getResource(): null|\Chill\PersonBundle\Entity\Person|\Chill\ThirdPartyBundle\Entity\ThirdParty
public function getResource(): Person|ThirdParty|null
{
return $this->person ?? $this->thirdParty;
}
@@ -124,7 +124,7 @@ class Resource
return $this;
}
public function setComment(string $comment = null): self
public function setComment(?string $comment = null): self
{
$this->comment = (string) $comment;

View File

@@ -58,7 +58,8 @@ class UserHistory implements TrackCreationInterface
* @ORM\Column(type="datetime_immutable", nullable=false, options={"default": "now()"})
*/
private \DateTimeImmutable $startDate = new \DateTimeImmutable('now')
) {}
) {
}
public function getAccompanyingPeriod(): AccompanyingPeriod
{

View File

@@ -18,5 +18,5 @@ interface HasPerson
{
public function getPerson(): ?Person;
public function setPerson(Person $person = null): HasPerson;
public function setPerson(?Person $person = null): HasPerson;
}

View File

@@ -214,7 +214,7 @@ class Household
*
* @Serializer\SerializedName("current_address")
*/
public function getCurrentAddress(\DateTime $at = null): ?Address
public function getCurrentAddress(?\DateTime $at = null): ?Address
{
$at ??= new \DateTime('today');
@@ -234,7 +234,7 @@ class Household
*
* @Serializer\SerializedName("current_composition")
*/
public function getCurrentComposition(\DateTimeImmutable $at = null): ?HouseholdComposition
public function getCurrentComposition(?\DateTimeImmutable $at = null): ?HouseholdComposition
{
$at ??= new \DateTimeImmutable('today');
$criteria = new Criteria();
@@ -262,12 +262,12 @@ class Household
/**
* @Serializer\Groups({"docgen:read"})
*/
public function getCurrentMembers(\DateTimeImmutable $now = null): Collection
public function getCurrentMembers(?\DateTimeImmutable $now = null): Collection
{
return $this->getMembers()->matching($this->buildCriteriaCurrentMembers($now));
}
public function getCurrentMembersByPosition(Position $position, \DateTimeInterface $now = null)
public function getCurrentMembersByPosition(Position $position, ?\DateTimeInterface $now = null)
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -286,7 +286,7 @@ class Household
*
* @Serializer\SerializedName("current_members_id")
*/
public function getCurrentMembersIds(\DateTimeImmutable $now = null): ReadableCollection
public function getCurrentMembersIds(?\DateTimeImmutable $now = null): ReadableCollection
{
return $this->getCurrentMembers($now)->map(
static fn (HouseholdMember $m) => $m->getId()
@@ -296,7 +296,7 @@ class Household
/**
* @return HouseholdMember[]
*/
public function getCurrentMembersOrdered(\DateTimeImmutable $now = null): Collection
public function getCurrentMembersOrdered(?\DateTimeImmutable $now = null): Collection
{
$members = $this->getCurrentMembers($now);
@@ -338,7 +338,7 @@ class Household
return $members;
}
public function getCurrentMembersWithoutPosition(\DateTimeInterface $now = null)
public function getCurrentMembersWithoutPosition(?\DateTimeInterface $now = null)
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -355,7 +355,7 @@ class Household
*
* @return ReadableCollection<(int|string), Person>
*/
public function getCurrentPersons(\DateTimeImmutable $now = null): ReadableCollection
public function getCurrentPersons(?\DateTimeImmutable $now = null): ReadableCollection
{
return $this->getCurrentMembers($now)
->map(static fn (HouseholdMember $m) => $m->getPerson());
@@ -424,7 +424,7 @@ class Household
});
}
public function getNonCurrentMembers(\DateTimeImmutable $now = null): Collection
public function getNonCurrentMembers(?\DateTimeImmutable $now = null): Collection
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -444,7 +444,7 @@ class Household
return $this->getMembers()->matching($criteria);
}
public function getNonCurrentMembersByPosition(Position $position, \DateTimeInterface $now = null)
public function getNonCurrentMembersByPosition(Position $position, ?\DateTimeInterface $now = null)
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -454,7 +454,7 @@ class Household
return $this->getNonCurrentMembers($now)->matching($criteria);
}
public function getNonCurrentMembersWithoutPosition(\DateTimeInterface $now = null)
public function getNonCurrentMembersWithoutPosition(?\DateTimeInterface $now = null)
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -644,7 +644,7 @@ class Household
}
}
private function buildCriteriaCurrentMembers(\DateTimeImmutable $now = null): Criteria
private function buildCriteriaCurrentMembers(?\DateTimeImmutable $now = null): Criteria
{
$criteria = new Criteria();
$expr = Criteria::expr();

View File

@@ -153,7 +153,7 @@ class HouseholdMember
return $this->startDate;
}
public function isCurrent(\DateTimeImmutable $at = null): bool
public function isCurrent(?\DateTimeImmutable $at = null): bool
{
$at ??= new \DateTimeImmutable('now');
@@ -174,7 +174,7 @@ class HouseholdMember
return $this;
}
public function setEndDate(\DateTimeImmutable $endDate = null): self
public function setEndDate(?\DateTimeImmutable $endDate = null): self
{
$this->endDate = $endDate;

View File

@@ -52,7 +52,7 @@ class PersonHouseholdAddress
*
* @ORM\JoinColumn(nullable=false)
*/
private ?\Chill\MainBundle\Entity\Address $address = null;
private ?Address $address = null;
/**
* @ORM\Id
@@ -61,7 +61,7 @@ class PersonHouseholdAddress
*
* @ORM\JoinColumn(nullable=false)
*/
private ?\Chill\PersonBundle\Entity\Household\Household $household = null;
private ?Household $household = null;
/**
* @ORM\Id
@@ -70,7 +70,7 @@ class PersonHouseholdAddress
*
* @ORM\JoinColumn(nullable=false)
*/
private ?\Chill\PersonBundle\Entity\Person $person = null;
private ?Person $person = null;
/**
* @ORM\Column(type="date_immutable")

View File

@@ -227,7 +227,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\MainBundle\Entity\Civility $civility = null;
private ?Civility $civility = null;
/**
* Contact information for contacting the person.
@@ -245,7 +245,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\MainBundle\Entity\Country $countryOfBirth = null;
private ?Country $countryOfBirth = null;
/**
* @ORM\Column(type="datetime", nullable=true, options={"default": NULL})
@@ -257,7 +257,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\MainBundle\Entity\User $createdBy = null;
private ?User $createdBy = null;
/**
* Cache the computation of household.
@@ -390,7 +390,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\PersonBundle\Entity\MaritalStatus $maritalStatus = null;
private ?MaritalStatus $maritalStatus = null;
/**
* Comment on marital status.
@@ -433,7 +433,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\MainBundle\Entity\Country $nationality = null;
private ?Country $nationality = null;
/**
* Number of children.
@@ -525,7 +525,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* targetEntity=User::class
* )
*/
private ?\Chill\MainBundle\Entity\User $updatedBy = null;
private ?User $updatedBy = null;
/**
* Person constructor.
@@ -671,7 +671,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @throws \Exception if two lines of the accompanying period are open
*/
public function close(AccompanyingPeriod $accompanyingPeriod = null): void
public function close(?AccompanyingPeriod $accompanyingPeriod = null): void
{
$this->proxyAccompanyingPeriodOpenState = false;
}
@@ -854,7 +854,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @throws \Exception
*/
public function getAddressAt(\DateTimeInterface $at = null): ?Address
public function getAddressAt(?\DateTimeInterface $at = null): ?Address
{
$at ??= new \DateTime('now');
@@ -1035,7 +1035,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $currentAccompanyingPeriods;
}
public function getCurrentHousehold(\DateTimeImmutable $at = null): ?Household
public function getCurrentHousehold(?\DateTimeImmutable $at = null): ?Household
{
$participation = $this->getCurrentHouseholdParticipationShareHousehold($at);
@@ -1050,7 +1050,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* if the given date is 'now', use instead @see{getCurrentPersonAddress}, which is optimized on
* database side.
*/
public function getCurrentHouseholdAddress(\DateTimeImmutable $at = null): ?Address
public function getCurrentHouseholdAddress(?\DateTimeImmutable $at = null): ?Address
{
if (
null === $at
@@ -1084,7 +1084,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return null;
}
public function getCurrentHouseholdParticipationShareHousehold(\DateTimeImmutable $at = null): ?HouseholdMember
public function getCurrentHouseholdParticipationShareHousehold(?\DateTimeImmutable $at = null): ?HouseholdMember
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -1253,7 +1253,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @throws \Exception
*/
public function getLastAddress(\DateTime $from = null)
public function getLastAddress(?\DateTime $from = null)
{
return $this->getCurrentHouseholdAddress(
null !== $from ? \DateTimeImmutable::createFromMutable($from) : null
@@ -1356,7 +1356,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* @return PersonResource[]|Collection
*/
public function getResources(): array|\Doctrine\Common\Collections\Collection
public function getResources(): array|Collection
{
return $this->resources;
}
@@ -1381,7 +1381,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this->updatedBy;
}
public function hasCurrentHouseholdAddress(\DateTimeImmutable $at = null): bool
public function hasCurrentHouseholdAddress(?\DateTimeImmutable $at = null): bool
{
return null !== $this->getCurrentHouseholdAddress($at);
}
@@ -1468,7 +1468,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return false;
}
public function isSharingHousehold(\DateTimeImmutable $at = null): bool
public function isSharingHousehold(?\DateTimeImmutable $at = null): bool
{
return null !== $this->getCurrentHousehold($at);
}
@@ -1619,7 +1619,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this;
}
public function setCivility(Civility $civility = null): self
public function setCivility(?Civility $civility = null): self
{
$this->civility = $civility;
@@ -1637,7 +1637,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this;
}
public function setCountryOfBirth(Country $countryOfBirth = null): self
public function setCountryOfBirth(?Country $countryOfBirth = null): self
{
$this->countryOfBirth = $countryOfBirth;
@@ -1707,7 +1707,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this;
}
public function setMaritalStatus(MaritalStatus $maritalStatus = null): self
public function setMaritalStatus(?MaritalStatus $maritalStatus = null): self
{
$this->maritalStatus = $maritalStatus;
@@ -1748,7 +1748,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this;
}
public function setNationality(Country $nationality = null): self
public function setNationality(?Country $nationality = null): self
{
$this->nationality = $nationality;

View File

@@ -59,7 +59,8 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac
* @ORM\Column(type="date_immutable", nullable=false)
*/
private ?\DateTimeImmutable $startDate = null
) {}
) {
}
public function getCenter(): ?Center
{

View File

@@ -52,7 +52,7 @@ class PersonAltName
* inversedBy="altNames"
* )
*/
private ?\Chill\PersonBundle\Entity\Person $person = null;
private ?Person $person = null;
/**
* Get id.
@@ -116,7 +116,7 @@ class PersonAltName
/**
* @return $this
*/
public function setPerson(Person $person = null)
public function setPerson(?Person $person = null)
{
$this->person = $person;

View File

@@ -43,17 +43,17 @@ class PersonNotDuplicate
/**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private ?\Chill\PersonBundle\Entity\Person $person1 = null;
private ?Person $person1 = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private ?\Chill\PersonBundle\Entity\Person $person2 = null;
private ?Person $person2 = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*/
private ?\Chill\MainBundle\Entity\User $user = null;
private ?User $user = null;
public function __construct()
{

View File

@@ -147,10 +147,16 @@ class Relationship implements TrackCreationInterface, TrackUpdateInterface
public function getOpposite(Person $counterpart): Person
{
if ($this->fromPerson !== $counterpart && $this->toPerson !== $counterpart) {
throw new \RuntimeException('the counterpart is neither the from nor to person for this relationship');
// during tests, comparing using equality does not work. We have to compare the ids
if (
($this->fromPerson->getId() === $counterpart->getId() && $this->toPerson->getId() === $counterpart->getId())
|| null === $counterpart->getId()
) {
throw new \RuntimeException(sprintf('the counterpart is neither the from nor to person for this relationship, expecting counterpart from %d and available %d and %d', $counterpart->getId(), $this->getFromPerson()->getId(), $this->getToPerson()->getId()));
}
}
if ($this->fromPerson === $counterpart) {
if ($this->fromPerson === $counterpart || $this->fromPerson->getId() === $counterpart->getId()) {
return $this->toPerson;
}

View File

@@ -79,7 +79,7 @@ class SocialAction
/**
* @ORM\ManyToOne(targetEntity=SocialIssue::class, inversedBy="socialActions")
*/
private ?\Chill\PersonBundle\Entity\SocialWork\SocialIssue $issue = null;
private ?SocialIssue $issue = null;
/**
* @ORM\Column(type="float", name="ordering", options={"default": 0.0})
@@ -89,7 +89,7 @@ class SocialAction
/**
* @ORM\ManyToOne(targetEntity=SocialAction::class, inversedBy="children")
*/
private ?\Chill\PersonBundle\Entity\SocialWork\SocialAction $parent = null;
private ?SocialAction $parent = null;
/**
* @var Collection<Result>
@@ -166,7 +166,7 @@ class SocialAction
*
* @return Collection|SocialAction[] a list with the elements of the given list which are parent of other elements in the given list
*/
public static function findAncestorSocialActions(array|\Doctrine\Common\Collections\Collection $socialActions): Collection
public static function findAncestorSocialActions(array|Collection $socialActions): Collection
{
$ancestors = new ArrayCollection();
@@ -246,7 +246,7 @@ class SocialAction
/**
* @param Collection|SocialAction[] $socialActions
*/
public static function getDescendantsWithThisForActions(array|\Doctrine\Common\Collections\Collection $socialActions): Collection
public static function getDescendantsWithThisForActions(array|Collection $socialActions): Collection
{
$unique = [];

View File

@@ -57,7 +57,7 @@ class SocialIssue
/**
* @ORM\ManyToOne(targetEntity=SocialIssue::class, inversedBy="children")
*/
private ?\Chill\PersonBundle\Entity\SocialWork\SocialIssue $parent = null;
private ?SocialIssue $parent = null;
/**
* @var Collection<SocialAction>
@@ -115,7 +115,7 @@ class SocialIssue
*
* @return Collection|SocialIssue[]
*/
public static function findAncestorSocialIssues(array|\Doctrine\Common\Collections\Collection $socialIssues): Collection
public static function findAncestorSocialIssues(array|Collection $socialIssues): Collection
{
$ancestors = new ArrayCollection();

View File

@@ -29,7 +29,9 @@ class PersonAddressMoveEvent extends Event
private ?HouseholdMember $previousMembership = null;
public function __construct(private readonly Person $person) {}
public function __construct(private readonly Person $person)
{
}
/**
* Get the date of the move.

View File

@@ -17,7 +17,9 @@ use Symfony\Component\Security\Core\Security;
class AccompanyingPeriodWorkEventListener
{
public function __construct(private readonly Security $security) {}
public function __construct(private readonly Security $security)
{
}
public function prePersistAccompanyingPeriodWork(AccompanyingPeriodWork $work): void
{

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface;
class AdministrativeLocationAggregator implements AggregatorInterface
{
public function __construct(private readonly LocationRepository $locationRepository, private readonly TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private readonly LocationRepository $locationRepository, private readonly TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string
{

View File

@@ -48,7 +48,7 @@ final readonly class ClosingDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, mixed $data)
{
return function (null|string $value): string {
return function (string|null $value): string {
if ('_header' === $value) {
return 'export.aggregator.course.by_closing_date.header';
}

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface;
class ClosingMotiveAggregator implements AggregatorInterface
{
public function __construct(private readonly ClosingMotiveRepositoryInterface $motiveRepository, private readonly TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private readonly ClosingMotiveRepositoryInterface $motiveRepository, private readonly TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string
{

View File

@@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ConfidentialAggregator implements AggregatorInterface
{
public function __construct(private readonly TranslatorInterface $translator) {}
public function __construct(private readonly TranslatorInterface $translator)
{
}
public function addRole(): ?string
{

View File

@@ -16,7 +16,6 @@ use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Repository\UserJobRepository;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
@@ -28,7 +27,8 @@ class CreatorJobAggregator implements AggregatorInterface
public function __construct(
private readonly UserJobRepository $jobRepository,
private readonly TranslatableStringHelper $translatableStringHelper
) {}
) {
}
public function addRole(): ?string
{
@@ -58,7 +58,7 @@ class CreatorJobAggregator implements AggregatorInterface
->leftJoin(
UserJobHistory::class,
"{$p}_jobHistory",
Expr\Join::WITH,
Join::WITH,
$qb->expr()->andX(
$qb->expr()->eq("{$p}_jobHistory.user", "{$p}_userHistory.createdBy"), // et si il est null ?
$qb->expr()->andX(
@@ -79,7 +79,9 @@ class CreatorJobAggregator implements AggregatorInterface
return Declarations::ACP_TYPE;
}
public function buildForm(FormBuilderInterface $builder) {}
public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array
{

View File

@@ -26,7 +26,9 @@ final readonly class DurationAggregator implements AggregatorInterface
'day',
];
public function __construct(private TranslatorInterface $translator) {}
public function __construct(private TranslatorInterface $translator)
{
}
public function addRole(): ?string
{

View File

@@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class EmergencyAggregator implements AggregatorInterface
{
public function __construct(private readonly TranslatorInterface $translator) {}
public function __construct(private readonly TranslatorInterface $translator)
{
}
public function addRole(): ?string
{

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class EvaluationAggregator implements AggregatorInterface
{
public function __construct(private EvaluationRepository $evaluationRepository, private TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private EvaluationRepository $evaluationRepository, private TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string
{

View File

@@ -28,7 +28,9 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class GeographicalUnitStatAggregator implements AggregatorInterface
{
public function __construct(private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) {}
public function __construct(private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter)
{
}
public function addRole(): ?string
{

View File

@@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class IntensityAggregator implements AggregatorInterface
{
public function __construct(private readonly TranslatorInterface $translator) {}
public function __construct(private readonly TranslatorInterface $translator)
{
}
public function addRole(): ?string
{

View File

@@ -28,7 +28,8 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface
public function __construct(
private UserJobRepositoryInterface $userJobRepository,
private TranslatableStringHelperInterface $translatableStringHelper,
) {}
) {
}
public function addRole(): ?string
{
@@ -72,7 +73,9 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface
return Declarations::ACP_TYPE;
}
public function buildForm(FormBuilderInterface $builder) {}
public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array
{
@@ -81,7 +84,7 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data): \Closure
{
return function (null|int|string $jobId) {
return function (int|string|null $jobId) {
if (null === $jobId || '' === $jobId) {
return '';
}

View File

@@ -48,7 +48,7 @@ final readonly class OpeningDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, mixed $data)
{
return function (null|string $value): string {
return function (string|null $value): string {
if ('_header' === $value) {
return 'export.aggregator.course.by_opening_date.header';
}

View File

@@ -0,0 +1,78 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\PersonBundle\Export\Declarations;
use Chill\PersonBundle\Export\Helper\LabelPersonHelper;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
final readonly class PersonParticipatingAggregator implements AggregatorInterface
{
private const KEY = 'acp_person_part_agg';
public function __construct(
private LabelPersonHelper $labelPersonHelper,
) {
}
public function buildForm(FormBuilderInterface $builder)
{
// nothing to do here
}
public function getFormDefaultData(): array
{
return [];
}
public function getLabels($key, array $values, mixed $data)
{
return match ($key) {
self::KEY => $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.course.by-user.header'),
default => throw new \UnexpectedValueException('key not supported: '.$key),
};
}
public function getQueryKeys($data)
{
return [self::KEY];
}
public function getTitle()
{
return 'export.aggregator.course.by-user.title';
}
public function addRole(): ?string
{
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
{
$k = self::KEY;
if (!in_array('acppart', $qb->getAllAliases(), true)) {
$qb->join('acp.participations', 'acppart');
}
$qb->addSelect("IDENTITY(acppart.person) AS {$k}")
->addGroupBy($k);
}
public function applyOn()
{
return Declarations::ACP_TYPE;
}
}

View File

@@ -27,7 +27,9 @@ final readonly class ReferrerAggregator implements AggregatorInterface
private const P = 'acp_ref_agg_date';
public function __construct(private UserRepository $userRepository, private UserRender $userRender, private RollingDateConverterInterface $rollingDateConverter) {}
public function __construct(private UserRepository $userRepository, private UserRender $userRender, private RollingDateConverterInterface $rollingDateConverter)
{
}
public function addRole(): ?string
{

View File

@@ -27,7 +27,8 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface
public function __construct(
private ScopeRepositoryInterface $scopeRepository,
private TranslatableStringHelperInterface $translatableStringHelper,
) {}
) {
}
public function addRole(): ?string
{
@@ -78,7 +79,9 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface
return Declarations::ACP_TYPE;
}
public function buildForm(FormBuilderInterface $builder) {}
public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array
{

View File

@@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final readonly class RequestorAggregator implements AggregatorInterface
{
public function __construct(private TranslatorInterface $translator) {}
public function __construct(private TranslatorInterface $translator)
{
}
public function addRole(): ?string
{

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class ScopeAggregator implements AggregatorInterface
{
public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string
{

View File

@@ -28,7 +28,8 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa
public function __construct(
private ScopeRepositoryInterface $scopeRepository,
private TranslatableStringHelperInterface $translatableStringHelper,
) {}
) {
}
public function addRole(): ?string
{
@@ -72,7 +73,9 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa
return Declarations::ACP_TYPE;
}
public function buildForm(FormBuilderInterface $builder) {}
public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array
{
@@ -81,7 +84,7 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa
public function getLabels($key, array $values, $data): \Closure
{
return function (null|int|string $scopeId) {
return function (int|string|null $scopeId) {
if (null === $scopeId || '' === $scopeId) {
return '';
}

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class SocialActionAggregator implements AggregatorInterface
{
public function __construct(private SocialActionRender $actionRender, private SocialActionRepository $actionRepository) {}
public function __construct(private SocialActionRender $actionRender, private SocialActionRepository $actionRepository)
{
}
public function addRole(): ?string
{

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class SocialIssueAggregator implements AggregatorInterface
{
public function __construct(private SocialIssueRepository $issueRepository, private SocialIssueRender $issueRender) {}
public function __construct(private SocialIssueRepository $issueRepository, private SocialIssueRender $issueRender)
{
}
public function addRole(): ?string
{

View File

@@ -27,7 +27,9 @@ final readonly class StepAggregator implements AggregatorInterface
private const P = 'acp_step_agg_date';
public function __construct(private RollingDateConverterInterface $rollingDateConverter, private TranslatorInterface $translator) {}
public function __construct(private RollingDateConverterInterface $rollingDateConverter, private TranslatorInterface $translator)
{
}
public function addRole(): ?string
{

View File

@@ -27,7 +27,8 @@ final readonly class UserJobAggregator implements AggregatorInterface
public function __construct(
private UserJobRepository $jobRepository,
private TranslatableStringHelper $translatableStringHelper
) {}
) {
}
public function addRole(): ?string
{
@@ -78,7 +79,9 @@ final readonly class UserJobAggregator implements AggregatorInterface
return Declarations::ACP_TYPE;
}
public function buildForm(FormBuilderInterface $builder) {}
public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array
{

View File

@@ -27,7 +27,8 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac
public function __construct(
private UserRender $userRender,
private UserRepositoryInterface $userRepository,
) {}
) {
}
public function buildForm(FormBuilderInterface $builder)
{
@@ -41,7 +42,7 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac
public function getLabels($key, array $values, $data): \Closure
{
return function (null|int|string $userId) {
return function (int|string|null $userId) {
if (null === $userId || '' === $userId) {
return '';
}

View File

@@ -0,0 +1,84 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Export\Aggregator\AccompanyingPeriodStepHistoryAggregators;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\PersonBundle\Export\Declarations;
use Chill\PersonBundle\Repository\AccompanyingPeriod\ClosingMotiveRepositoryInterface;
use Chill\PersonBundle\Templating\Entity\ClosingMotiveRender;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
final readonly class ByClosingMotiveAggregator implements AggregatorInterface
{
private const KEY = 'acpstephistory_by_closing_motive_agg';
public function __construct(
private ClosingMotiveRepositoryInterface $closingMotiveRepository,
private ClosingMotiveRender $closingMotiveRender,
) {
}
public function buildForm(FormBuilderInterface $builder)
{
// nothing to add here
}
public function getFormDefaultData(): array
{
return [];
}
public function getLabels($key, array $values, mixed $data)
{
return function (int|string|null $value): string {
if ('_header' === $value) {
return 'export.aggregator.step_history.by_closing_motive.header';
}
if (null === $value || '' === $value || null === $closingMotive = $this->closingMotiveRepository->find((int) $value)) {
return '';
}
return $this->closingMotiveRender->renderString($closingMotive, []);
};
}
public function getQueryKeys($data)
{
return [
self::KEY,
];
}
public function getTitle()
{
return 'export.aggregator.step_history.by_closing_motive.title';
}
public function addRole(): ?string
{
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
{
$qb
->addSelect('IDENTITY(acpstephistory.closingMotive) AS '.self::KEY)
->addGroupBy(self::KEY);
}
public function applyOn()
{
return Declarations::ACP_STEP_HISTORY;
}
}

View File

@@ -0,0 +1,90 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Export\Aggregator\AccompanyingPeriodStepHistoryAggregators;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\PersonBundle\Export\Declarations;
use Chill\PersonBundle\Export\Enum\DateGroupingChoiceEnum;
use Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingPeriodStepHistoryAggregators\ByDateAggregatorTest;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
/**
* @see ByDateAggregatorTest
*/
final readonly class ByDateAggregator implements AggregatorInterface
{
private const KEY = 'acpstephistory_by_date_agg';
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('frequency', ChoiceType::class, [
'choices' => array_combine(
array_map(fn (DateGroupingChoiceEnum $c) => 'export.enum.frequency.'.$c->value, DateGroupingChoiceEnum::cases()),
array_map(fn (DateGroupingChoiceEnum $c) => $c->value, DateGroupingChoiceEnum::cases()),
),
'label' => 'export.aggregator.course.by_opening_date.frequency',
'multiple' => false,
'expanded' => true,
]);
}
public function getFormDefaultData(): array
{
return ['frequency' => DateGroupingChoiceEnum::YEAR->value];
}
public function getLabels($key, array $values, mixed $data)
{
return function (?string $value): string {
if ('_header' === $value) {
return 'export.aggregator.step_history.by_date.header';
}
if (null === $value || '' === $value) {
return '';
}
return $value;
};
}
public function getQueryKeys($data)
{
return [self::KEY];
}
public function getTitle()
{
return 'export.aggregator.step_history.by_date.title';
}
public function addRole(): ?string
{
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::KEY;
$qb->addSelect(sprintf("TO_CHAR(acpstephistory.startDate, '%s') AS {$p}", $data['frequency']));
$qb->addGroupBy($p);
$qb->addOrderBy($p, 'DESC');
}
public function applyOn()
{
return Declarations::ACP_STEP_HISTORY;
}
}

View File

@@ -0,0 +1,86 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Export\Aggregator\AccompanyingPeriodStepHistoryAggregators;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\PersonBundle\Export\Declarations;
use Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingPeriodStepHistoryAggregators\ByStepAggregatorTest;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* @see ByStepAggregatorTest
*/
final readonly class ByStepAggregator implements AggregatorInterface
{
private const KEY = 'acpstephistory_step_agg';
public function __construct(
private TranslatorInterface $translator
) {
}
public function buildForm(FormBuilderInterface $builder)
{
// nothing in this form
}
public function getFormDefaultData(): array
{
return [];
}
public function getLabels($key, array $values, mixed $data)
{
return function (?string $step): string {
if ('_header' === $step) {
return 'export.aggregator.step_history.by_step.header';
}
if (null === $step || '' === $step) {
return '';
}
return $this->translator->trans('accompanying_period.'.$step);
};
}
public function getQueryKeys($data)
{
return [
self::KEY,
];
}
public function getTitle()
{
return 'export.aggregator.step_history.by_step.title';
}
public function addRole(): ?string
{
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
{
$qb
->addSelect('acpstephistory.step AS '.self::KEY)
->addGroupBy(self::KEY);
}
public function applyOn()
{
return Declarations::ACP_STEP_HISTORY;
}
}

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface;
class EvaluationTypeAggregator implements AggregatorInterface
{
public function __construct(private readonly EvaluationRepository $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private readonly EvaluationRepository $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string
{

View File

@@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class HavingEndDateAggregator implements AggregatorInterface
{
public function __construct(private readonly TranslatorInterface $translator) {}
public function __construct(private readonly TranslatorInterface $translator)
{
}
public function addRole(): ?string
{

View File

@@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface;
class ChildrenNumberAggregator implements AggregatorInterface
{
public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {}
public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter)
{
}
public function addRole(): ?string
{
@@ -70,7 +72,7 @@ class ChildrenNumberAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return static function (null|int|string $value): string {
return static function (int|string|null $value): string {
if ('_header' === $value) {
return 'Number of children';
}

View File

@@ -24,7 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface;
class CompositionAggregator implements AggregatorInterface
{
public function __construct(private readonly HouseholdCompositionTypeRepository $typeRepository, private readonly TranslatableStringHelper $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {}
public function __construct(private readonly HouseholdCompositionTypeRepository $typeRepository, private readonly TranslatableStringHelper $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter)
{
}
public function addRole(): ?string
{

View File

@@ -24,7 +24,8 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement
{
public function __construct(
private RollingDateConverterInterface $rollingDateConverter,
) {}
) {
}
public function addRole(): ?string
{

View File

@@ -27,7 +27,9 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface
{
private const PREFIX = 'acp_by_household_compo_agg';
public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
{
}
public function addRole(): ?string
{

View File

@@ -27,7 +27,8 @@ final readonly class CenterAggregator implements AggregatorInterface
public function __construct(
private CenterRepositoryInterface $centerRepository,
private RollingDateConverterInterface $rollingDateConverter,
) {}
) {
}
public function buildForm(FormBuilderInterface $builder)
{
@@ -45,7 +46,7 @@ final readonly class CenterAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data): \Closure
{
return function (null|int|string $value) {
return function (int|string|null $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -25,7 +25,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final readonly class CountryOfBirthAggregator implements AggregatorInterface, ExportElementValidatedInterface
{
public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) {}
public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator)
{
}
public function addRole(): ?string
{

View File

@@ -20,7 +20,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final readonly class GenderAggregator implements AggregatorInterface
{
public function __construct(private TranslatorInterface $translator) {}
public function __construct(private TranslatorInterface $translator)
{
}
public function addRole(): ?string
{
@@ -39,7 +41,9 @@ final readonly class GenderAggregator implements AggregatorInterface
return Declarations::PERSON_TYPE;
}
public function buildForm(FormBuilderInterface $builder) {}
public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array
{

View File

@@ -26,7 +26,9 @@ use Symfony\Component\Form\FormBuilderInterface;
class GeographicalUnitAggregator implements AggregatorInterface
{
public function __construct(private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {}
public function __construct(private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter)
{
}
public function addRole(): ?string
{

View File

@@ -28,7 +28,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final readonly class HouseholdPositionAggregator implements AggregatorInterface, ExportElementValidatedInterface
{
public function __construct(private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private PositionRepository $positionRepository, private RollingDateConverterInterface $rollingDateConverter) {}
public function __construct(private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private PositionRepository $positionRepository, private RollingDateConverterInterface $rollingDateConverter)
{
}
public function addRole(): ?string
{

View File

@@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class MaritalStatusAggregator implements AggregatorInterface
{
public function __construct(private MaritalStatusRepository $maritalStatusRepository, private TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private MaritalStatusRepository $maritalStatusRepository, private TranslatableStringHelper $translatableStringHelper)
{
}
public function addRole(): ?string
{

View File

@@ -24,7 +24,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final readonly class NationalityAggregator implements AggregatorInterface, ExportElementValidatedInterface
{
public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) {}
public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator)
{
}
public function addRole(): ?string
{

Some files were not shown because too many files have changed in this diff Show More