From eeb84d5cfb5579d66b43af51fb9b7df9dfb42bf1 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 2 Nov 2022 10:28:52 +0100 Subject: [PATCH] php csfixes --- .../ACPAggregators/ByActivityNumberAggregator.php | 4 ++-- .../Export/Aggregator/SentReceivedAggregator.php | 10 ++++++---- .../Export/Filter/ACPFilters/HasNoActivityFilter.php | 7 ++++--- .../Export/Filter/UsersJobFilter.php | 4 ++-- .../Export/Aggregator/ByActivityTypeAggregator.php | 6 +++--- .../src/Export/Declarations.php | 2 +- .../src/Export/Export/CountAsideActivity.php | 8 ++------ .../src/Export/Filter/ByActivityTypeFilter.php | 4 ++-- .../src/Export/Filter/ByDateFilter.php | 4 ++-- .../ByActionNumberAggregator.php | 4 ++-- .../ByHouseholdCompositionAggregator.php | 3 ++- .../CreatorJobAggregator.php | 4 ++-- .../EvaluationAggregators/ByEndDateAggregator.php | 4 ++-- .../EvaluationAggregators/ByMaxDateAggregator.php | 4 ++-- .../EvaluationAggregators/ByStartDateAggregator.php | 4 ++-- .../HavingEndDateAggregator.php | 9 +++++---- .../CurrentActionAggregator.php | 10 ++++++---- .../AccompanyingCourseFilters/CreatorFilter.php | 2 +- .../AccompanyingCourseFilters/CreatorJobFilter.php | 2 +- .../AccompanyingCourseFilters/HasNoActionFilter.php | 3 ++- .../HasNoReferrerFilter.php | 12 ++++++------ .../HasTemporaryLocationFilter.php | 2 +- .../Filter/EvaluationFilters/ByEndDateFilter.php | 4 ++-- .../Filter/EvaluationFilters/ByStartDateFilter.php | 4 ++-- .../EvaluationFilters/CurrentEvaluationsFilter.php | 2 +- .../Filter/SocialWorkFilters/CurrentActionFilter.php | 2 +- 26 files changed, 64 insertions(+), 60 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php index 44a3fd8f0..de35f75cc 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -/** +/* * Chill is a software for social workers * * For the full copyright and license information, please view @@ -41,7 +41,7 @@ class ByActivityNumberAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return function ($value): string { + return static function ($value): string { if ('_header' === $value) { return ''; } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php index b5300834c..2a6dec7f7 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -/** +/* * Chill is a software for social workers * * For the full copyright and license information, please view @@ -11,9 +11,10 @@ declare(strict_types=1); namespace Chill\ActivityBundle\Export\Aggregator; -use Chill\MainBundle\Export\AggregatorInterface; use Chill\ActivityBundle\Export\Declarations; +use Chill\MainBundle\Export\AggregatorInterface; use Doctrine\ORM\QueryBuilder; +use LogicException; use Symfony\Component\Form\FormBuilderInterface; class SentReceivedAggregator implements AggregatorInterface @@ -41,10 +42,11 @@ class SentReceivedAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return function ($value): string { + return static function ($value): string { if ('_header' === $value) { return ''; } + switch ($value) { case 'sent': return 'is sent'; @@ -53,7 +55,7 @@ class SentReceivedAggregator implements AggregatorInterface return 'is received'; default: - throw new \LogicException(sprintf('The value %s is not valid', $value)); + throw new LogicException(sprintf('The value %s is not valid', $value)); } }; } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php index 13aaf475a..508644a07 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php @@ -14,9 +14,10 @@ namespace Chill\ActivityBundle\Export\Filter\ACPFilters; use Chill\ActivityBundle\Entity\Activity; use Chill\MainBundle\Export\FilterInterface; use Chill\PersonBundle\Export\Declarations; +use Doctrine\ORM\Query\Expr; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; -use Doctrine\ORM\Query\Expr; +use function in_array; class HasNoActivityFilter implements FilterInterface { @@ -36,7 +37,7 @@ class HasNoActivityFilter implements FilterInterface //TODO check this: ->andWhere(' NOT EXISTS ( - SELECT 1 FROM '. Activity::class .' activity + SELECT 1 FROM ' . Activity::class . ' activity WHERE activity.accompanyingPeriod = acp ) '); @@ -61,4 +62,4 @@ class HasNoActivityFilter implements FilterInterface { return 'Filter acp which has no activity'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php index dcdacd84a..b52ef441c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php @@ -39,9 +39,9 @@ class UsersJobFilter implements FilterInterface $qb ->andWhere( $qb->expr()->exists( - 'SELECT 1 FROM ' . Activity::class . ' activity_users_job_filter_act + 'SELECT 1 FROM ' . Activity::class . ' activity_users_job_filter_act JOIN activity_users_job_filter_act.users users WHERE users.userJob IN (:activity_users_job_filter_jobs) AND activity_users_job_filter_act = activity ' - ) + ) ) ->setParameter('activity_users_job_filter_jobs', $data['jobs']); } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php index d15d107aa..488885bde 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -/** +/* * Chill is a software for social workers * * For the full copyright and license information, please view @@ -11,8 +11,8 @@ declare(strict_types=1); namespace Chill\AsideActivityBundle\Export\Aggregator; -use Chill\MainBundle\Export\AggregatorInterface; use Chill\AsideActivityBundle\Export\Declarations; +use Chill\MainBundle\Export\AggregatorInterface; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; @@ -41,7 +41,7 @@ class ByActivityTypeAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return function ($value): string { + return static function ($value): string { if ('_header' === $value) { return ''; } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Declarations.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Declarations.php index 7ddbec6de..8c808ea37 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Declarations.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Declarations.php @@ -17,4 +17,4 @@ namespace Chill\AsideActivityBundle\Export; abstract class Declarations { public const ASIDE_ACTIVITY_TYPE = 'aside_activity'; -} \ No newline at end of file +} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php index d6c391121..d1d69f0c8 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php @@ -11,14 +11,14 @@ declare(strict_types=1); namespace Chill\AsideActivityBundle\Export\Export; +use Chill\AsideActivityBundle\Export\Declarations; use Chill\AsideActivityBundle\Repository\AsideActivityRepository; use Chill\MainBundle\Export\ExportInterface; use Chill\MainBundle\Export\FormatterInterface; use Chill\MainBundle\Export\GroupedExportInterface; -use Chill\AsideActivityBundle\Export\Declarations; -use Symfony\Component\Form\FormBuilderInterface; use Doctrine\ORM\Query; use LogicException; +use Symfony\Component\Form\FormBuilderInterface; class CountAsideActivity implements ExportInterface, GroupedExportInterface { @@ -105,7 +105,3 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface return []; } } - - - - diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php index 53bd904fa..4f256538d 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php @@ -11,8 +11,8 @@ declare(strict_types=1); namespace Chill\AsideActivityBundle\Export\Filter; -use Chill\MainBundle\Export\FilterInterface; use Chill\AsideActivityBundle\Export\Declarations; +use Chill\MainBundle\Export\FilterInterface; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; @@ -52,4 +52,4 @@ class ByActivityTypeFilter implements FilterInterface { return 'Filter by aside activity type'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php index dbab304d2..d8fec664a 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php @@ -11,8 +11,8 @@ declare(strict_types=1); namespace Chill\AsideActivityBundle\Export\Filter; -use Chill\MainBundle\Export\FilterInterface; use Chill\AsideActivityBundle\Export\Declarations; +use Chill\MainBundle\Export\FilterInterface; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; @@ -52,4 +52,4 @@ class ByDateFilter implements FilterInterface { return 'Filter by aside activity date'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php index 3c16aa161..0f51b6feb 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -/** +/* * Chill is a software for social workers * * For the full copyright and license information, please view @@ -41,7 +41,7 @@ class ByActionNumberAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return function ($value): string { + return static function ($value): string { if ('_header' === $value) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByHouseholdCompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByHouseholdCompositionAggregator.php index e96c8a228..f299762e6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByHouseholdCompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByHouseholdCompositionAggregator.php @@ -18,6 +18,7 @@ use Chill\PersonBundle\Entity\Household\HouseholdComposition; use Chill\PersonBundle\Entity\Household\HouseholdMember; use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Repository\Household\HouseholdCompositionTypeRepositoryInterface; +use DateTimeImmutable; use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; @@ -96,7 +97,7 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface $builder->add('date_calc', ChillDateType::class, [ 'label' => 'export.aggregator.course.by_household_composition.Calc date', 'input_format' => 'datetime_immutable', - 'data' => new \DateTimeImmutable('now'), + 'data' => new DateTimeImmutable('now'), ]); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php index 1449091e7..c473bf7a1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -/** +/* * Chill is a software for social workers * * For the full copyright and license information, please view @@ -41,7 +41,7 @@ class CreatorJobAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return function ($value): string { + return static function ($value): string { if ('_header' === $value) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php index 9c90c8dd3..40b035a02 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -/** +/* * Chill is a software for social workers * * For the full copyright and license information, please view @@ -41,7 +41,7 @@ class ByEndDateAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return function ($value): string { + return static function ($value): string { if ('_header' === $value) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php index ded9fb685..36ab0f50b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -/** +/* * Chill is a software for social workers * * For the full copyright and license information, please view @@ -41,7 +41,7 @@ class ByMaxDateAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return function ($value): string { + return static function ($value): string { if ('_header' === $value) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php index 121171d8c..e64245d53 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -/** +/* * Chill is a software for social workers * * For the full copyright and license information, please view @@ -41,7 +41,7 @@ class ByStartDateAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return function ($value): string { + return static function ($value): string { if ('_header' === $value) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php index 8def8cf88..af801b74d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -/** +/* * Chill is a software for social workers * * For the full copyright and license information, please view @@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Export\Aggregator\EvaluationAggregators; use Chill\MainBundle\Export\AggregatorInterface; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; +use LogicException; use Symfony\Component\Form\FormBuilderInterface; class HavingEndDateAggregator implements AggregatorInterface @@ -45,10 +46,11 @@ class HavingEndDateAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return function ($value): string { + return static function ($value): string { if ('_header' === $value) { return ''; } + switch ($value) { case true: return 'enddate is specified'; @@ -57,9 +59,8 @@ class HavingEndDateAggregator implements AggregatorInterface return 'enddate is not specified'; default: - throw new \LogicException(sprintf('The value %s is not valid', $value)); + throw new LogicException(sprintf('The value %s is not valid', $value)); } - }; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php index d9120d121..a77838167 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -/** +/* * Chill is a software for social workers * * For the full copyright and license information, please view @@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators; use Chill\MainBundle\Export\AggregatorInterface; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; +use LogicException; use Symfony\Component\Form\FormBuilderInterface; class CurrentActionAggregator implements AggregatorInterface @@ -27,7 +28,7 @@ class CurrentActionAggregator implements AggregatorInterface { $qb ->addSelect(' - (CASE true WHEN acpw.startDate IS NULL ELSE false END) + (CASE true WHEN acpw.startDate IS NULL ELSE false END) AS acpw_current_action_aggregator ') ->addGroupBy('acpw_current_action_aggregator'); @@ -45,10 +46,11 @@ class CurrentActionAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return function ($value): string { + return static function ($value): string { if ('_header' === $value) { return ''; } + switch ($value) { case true: return 'Current action'; @@ -57,7 +59,7 @@ class CurrentActionAggregator implements AggregatorInterface return 'Not current action'; default: - throw new \LogicException(sprintf('The value %s is not valid', $value)); + throw new LogicException(sprintf('The value %s is not valid', $value)); } }; } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php index 7dd78d0b4..c7e110f62 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php @@ -52,4 +52,4 @@ class CreatorFilter implements FilterInterface { return 'Filter by creator'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php index 021d2227c..6f094fe97 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php @@ -52,4 +52,4 @@ class CreatorJobFilter implements FilterInterface { return 'Filter by creator job'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php index a26628e95..771b8d063 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php @@ -15,6 +15,7 @@ use Chill\MainBundle\Export\FilterInterface; use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; +use function in_array; class HasNoActionFilter implements FilterInterface { @@ -51,4 +52,4 @@ class HasNoActionFilter implements FilterInterface { return 'Filter by which has no action'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php index c37d423f8..b18bcd1de 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php @@ -15,10 +15,10 @@ use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\PersonBundle\Entity\AccompanyingPeriod\UserHistory; use Chill\PersonBundle\Export\Declarations; +use DateTime; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; -use DateTime; class HasNoReferrerFilter implements FilterInterface { @@ -32,12 +32,12 @@ class HasNoReferrerFilter implements FilterInterface $qb ->andWhere(' NOT EXISTS ( - SELECT 1 FROM '. UserHistory::class .' uh - WHERE uh.startDate < :date + SELECT 1 FROM ' . UserHistory::class . ' uh + WHERE uh.startDate < :date AND ( - uh.endDate IS NULL + uh.endDate IS NULL or uh.endDate > :date - ) + ) AND uh.accompanyingPeriod = acp ) ') @@ -69,4 +69,4 @@ class HasNoReferrerFilter implements FilterInterface { return 'Filter by which has no referrer'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php index 18a6c3918..85d8d93b6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php @@ -52,4 +52,4 @@ class HasTemporaryLocationFilter implements FilterInterface { return 'Filter by temporary location'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php index d40170447..5c509d50c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php @@ -14,10 +14,10 @@ namespace Chill\PersonBundle\Export\Filter\EvaluationFilters; use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\PersonBundle\Export\Declarations; +use DateTime; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; -use DateTime; class ByEndDateFilter implements FilterInterface { @@ -64,4 +64,4 @@ class ByEndDateFilter implements FilterInterface { return 'Filter by end date evaluations'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php index afa3c212a..e21a1ea68 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php @@ -14,10 +14,10 @@ namespace Chill\PersonBundle\Export\Filter\EvaluationFilters; use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\PersonBundle\Export\Declarations; +use DateTime; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; -use DateTime; class ByStartDateFilter implements FilterInterface { @@ -64,4 +64,4 @@ class ByStartDateFilter implements FilterInterface { return 'Filter by start date evaluations'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php index 293e551f1..50c95600e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php @@ -47,4 +47,4 @@ class CurrentEvaluationsFilter implements FilterInterface { return 'Filter by current evaluations'; } -} \ No newline at end of file +} diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php index ecbe6086a..cbf958182 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php @@ -47,4 +47,4 @@ class CurrentActionFilter implements FilterInterface { return 'Filter by current actions'; } -} \ No newline at end of file +}