From 0c5b35926b9cde76b427ced44a1e36d9f2caf85f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 29 Sep 2023 07:52:50 +0200 Subject: [PATCH] php cs fixer and phpstan --- .../Export/LinkedToACP/CountActivity.php | 3 +-- .../Export/Export/CountCalendars.php | 3 +-- .../Export/Export/StatCalendarAvgDuration.php | 1 - .../Export/AccompanyingCourseExportHelper.php | 19 ++++++++++++++----- .../AccompanyingCourseExportHelperTest.php | 16 ++++++++++++++-- .../AccompanyingPeriod/ClosingMotive.php | 4 ++-- .../migrations/Version20230918115305.php | 7 +++++++ 7 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php index b6615f8e5..81077be32 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php @@ -36,8 +36,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface public function __construct( EntityManagerInterface $em, AccompanyingCourseExportHelper $accompanyingCourseExportHelper - -) { + ) { $this->repository = $em->getRepository(Activity::class); $this->accompanyingCourseExportHelper = $accompanyingCourseExportHelper; } diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php index 3e96245c9..77a2cfbc8 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php @@ -33,8 +33,7 @@ class CountCalendars implements ExportInterface, GroupedExportInterface public function __construct( CalendarRepository $calendarRepository, AccompanyingCourseExportHelper $accompanyingCourseExportHelper - ) - { + ) { $this->calendarRepository = $calendarRepository; $this->accompanyingCourseExportHelper = $accompanyingCourseExportHelper; } diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php index 696bf02af..3adfa1727 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php @@ -32,7 +32,6 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface public function __construct( CalendarRepository $calendarRepository, AccompanyingCourseExportHelper $accompanyingCourseExportHelper - ) { $this->calendarRepository = $calendarRepository; $this->accompanyingCourseExportHelper = $accompanyingCourseExportHelper; diff --git a/src/Bundle/ChillMainBundle/Export/AccompanyingCourseExportHelper.php b/src/Bundle/ChillMainBundle/Export/AccompanyingCourseExportHelper.php index 3c49eb124..174548822 100644 --- a/src/Bundle/ChillMainBundle/Export/AccompanyingCourseExportHelper.php +++ b/src/Bundle/ChillMainBundle/Export/AccompanyingCourseExportHelper.php @@ -1,5 +1,14 @@ leftJoin('acp.closingMotive', 'cm') ->andWhere( - $qb->expr()->orX( - $qb->expr()->eq('cm.isCanceledAccompanyingPeriod', 'false'), - $qb->expr()->isNull('acp.closingMotive') - ) - ); + $qb->expr()->orX( + $qb->expr()->eq('cm.isCanceledAccompanyingPeriod', 'false'), + $qb->expr()->isNull('acp.closingMotive') + ) + ); return $qb; } diff --git a/src/Bundle/ChillMainBundle/Tests/Export/AccompanyingCourseExportHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Export/AccompanyingCourseExportHelperTest.php index a254a0d9c..bb124c4bb 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/AccompanyingCourseExportHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/AccompanyingCourseExportHelperTest.php @@ -1,5 +1,14 @@ em->getRepository(AccompanyingPeriod::class)->createQueryBuilder('acp'); $this->accompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb); diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/ClosingMotive.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/ClosingMotive.php index 0b5b66f77..cca307694 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/ClosingMotive.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/ClosingMotive.php @@ -163,9 +163,9 @@ class ClosingMotive return $this->children->count() > 0; } - public function isFalseAccompanyingPeriod(): bool + public function isCanceledAccompanyingPeriod(): bool { - return $this->isFalseAccompanyingPeriod; + return $this->isCanceledAccompanyingPeriod; } public function removeChildren(ClosingMotive $child): ClosingMotive diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230918115305.php b/src/Bundle/ChillPersonBundle/migrations/Version20230918115305.php index 684ff422b..3e3a3c643 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20230918115305.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230918115305.php @@ -2,6 +2,13 @@ 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\Migrations\Person; use Doctrine\DBAL\Schema\Schema;