From 3e39c0ced7ea371dfaba42ad1b0431d8247581a1 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 14 Nov 2023 14:33:50 +0100 Subject: [PATCH] rector and cs-fixer --- .changes/unreleased/Feature-20231114-143558.yaml | 7 +++++++ .../ChillActivityBundle/Controller/ActivityController.php | 4 ++-- .../Aggregator/SocialWorkAggregators/CreatorAggregator.php | 6 +++--- .../SocialWorkAggregators/CreatorJobAggregator.php | 6 +++--- .../SocialWorkAggregators/CreatorScopeAggregator.php | 6 +++--- .../Export/Filter/SocialWorkFilters/CreatorJobFilter.php | 6 +++--- .../Export/Filter/SocialWorkFilters/CreatorScopeFilter.php | 6 +++--- src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php | 2 +- 8 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 .changes/unreleased/Feature-20231114-143558.yaml diff --git a/.changes/unreleased/Feature-20231114-143558.yaml b/.changes/unreleased/Feature-20231114-143558.yaml new file mode 100644 index 000000000..edc72c027 --- /dev/null +++ b/.changes/unreleased/Feature-20231114-143558.yaml @@ -0,0 +1,7 @@ +kind: Feature +body: |+ + Add 3 new filters and 3 new aggregators for work action creator (with jobs and scopes) + +time: 2023-11-14T14:35:58.099418749+01:00 +custom: + Issue: "204" diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 06489010c..43c0b13bb 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -673,8 +673,8 @@ final class ActivityController extends AbstractController throw $this->createNotFoundException('Accompanying Period not found'); } - // TODO Add permission - // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); + // TODO Add permission + // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); } else { throw $this->createNotFoundException('Person or Accompanying Period not found'); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php index 9d03e3ba1..f7c203a4e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php @@ -23,8 +23,8 @@ class CreatorAggregator implements AggregatorInterface private const PREFIX = 'acpw_aggr_creator'; public function __construct( - private UserRepository $userRepository, - private UserRender $userRender + private readonly UserRepository $userRepository, + private readonly UserRender $userRender ) {} public function addRole(): ?string @@ -58,7 +58,7 @@ class CreatorAggregator implements AggregatorInterface return function ($value): string { if ('_header' === $value) { return 'export.aggregator.course_work.by_creator.Creator'; - }; + } if (null === $value || '' === $value) { return ''; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php index fd5444b62..1f7fdca5a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php @@ -44,12 +44,12 @@ class CreatorJobAggregator implements AggregatorInterface "{$p}_history", Join::WITH, $qb->expr()->andX( - $qb->expr()->eq("{$p}_history.user", "acpw.createdBy"), + $qb->expr()->eq("{$p}_history.user", 'acpw.createdBy'), $qb->expr()->andX( - $qb->expr()->lte("{$p}_history.startDate", "acpw.createdAt"), + $qb->expr()->lte("{$p}_history.startDate", 'acpw.createdAt'), $qb->expr()->orX( $qb->expr()->isNull("{$p}_history.endDate"), - $qb->expr()->gt("{$p}_history.endDate", "acpw.createdAt") + $qb->expr()->gt("{$p}_history.endDate", 'acpw.createdAt') ) ) ) diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php index fdbbf56a4..c57607693 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php @@ -44,12 +44,12 @@ class CreatorScopeAggregator implements AggregatorInterface "{$p}_history", Join::WITH, $qb->expr()->andX( - $qb->expr()->eq("{$p}_history.user", "acpw.createdBy"), + $qb->expr()->eq("{$p}_history.user", 'acpw.createdBy'), $qb->expr()->andX( - $qb->expr()->lte("{$p}_history.startDate", "acpw.createdAt"), + $qb->expr()->lte("{$p}_history.startDate", 'acpw.createdAt'), $qb->expr()->orX( $qb->expr()->isNull("{$p}_history.endDate"), - $qb->expr()->gt("{$p}_history.endDate", "acpw.createdAt") + $qb->expr()->gt("{$p}_history.endDate", 'acpw.createdAt') ) ) ) diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php index 47b5f4c9c..2b7a6ef07 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php @@ -46,12 +46,12 @@ class CreatorJobFilter implements FilterInterface "{$p}_history", Join::WITH, $qb->expr()->andX( - $qb->expr()->eq("{$p}_history.user", "acpw.createdBy"), + $qb->expr()->eq("{$p}_history.user", 'acpw.createdBy'), $qb->expr()->andX( - $qb->expr()->lte("{$p}_history.startDate", "acpw.createdAt"), + $qb->expr()->lte("{$p}_history.startDate", 'acpw.createdAt'), $qb->expr()->orX( $qb->expr()->isNull("{$p}_history.endDate"), - $qb->expr()->gt("{$p}_history.endDate", "acpw.createdAt") + $qb->expr()->gt("{$p}_history.endDate", 'acpw.createdAt') ) ) ) diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php index 996aa5272..16ed52755 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php @@ -46,12 +46,12 @@ class CreatorScopeFilter implements FilterInterface "{$p}_history", Join::WITH, $qb->expr()->andX( - $qb->expr()->eq("{$p}_history.user", "acpw.createdBy"), + $qb->expr()->eq("{$p}_history.user", 'acpw.createdBy'), $qb->expr()->andX( - $qb->expr()->lte("{$p}_history.startDate", "acpw.createdAt"), + $qb->expr()->lte("{$p}_history.startDate", 'acpw.createdAt'), $qb->expr()->orX( $qb->expr()->isNull("{$p}_history.endDate"), - $qb->expr()->gt("{$p}_history.endDate", "acpw.createdAt") + $qb->expr()->gt("{$p}_history.endDate", 'acpw.createdAt') ) ) ) diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 41e0140c8..046d553e9 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -100,7 +100,7 @@ class ThirdPartyType extends AbstractType 'label' => 'thirdparty.Contact data are confidential', ]); - // Institutional ThirdParty (parent) + // Institutional ThirdParty (parent) } else { $builder ->add('nameCompany', TextType::class, [